summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <blendoit@gmail.com>2019-06-12 12:03:17 -0700
committerMarius Peter <blendoit@gmail.com>2019-06-12 12:03:17 -0700
commite4727aa418c1bc6ecd2c495fed7f9ddb8e461445 (patch)
tree4e4c8c0a3affda2d83029ff86f729e94fe5f735e
parent976006fbe5f0a141af1041510a640a8e71a79150 (diff)
fixed I/O complaint after file write context guard
-rw-r--r--creator.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/creator.py b/creator.py
index 35784a8..eac3918 100644
--- a/creator.py
+++ b/creator.py
@@ -96,6 +96,8 @@ class Coordinates:
# self.print_coord(2)
with open(full_path, 'w') as sys.stdout:
self.print_coord(2)
+ # Following line required to reset value of sys.stdout
+ sys.stdout = sys.__stdout__
# It is cleaner to use this context guard to ensure file is closed
return None
Copyright 2019--2024 Marius PETER