summaryrefslogtreecommitdiff
path: root/embroider_params.py
diff options
context:
space:
mode:
authorcclauss <cclauss@bluewin.ch>2018-01-06 07:10:06 +0100
committerLex Neva <lexelby@users.noreply.github.com>2018-01-06 15:22:15 -0500
commitece8f15edaa6efcc617cc91508ac3ba6227a6254 (patch)
tree9c613f02eee91faefd727c0cf4bda2b1f7290e68 /embroider_params.py
parent218ec1b63d8c6b4e20df2be5a587e22b8bb3c817 (diff)
Use sys.stderr_backup in both save and restore
There is no __sys.stderr_backup__ defined in the [Python sys] module. __save_stderr()__ adds a variable by that name which is a bit unconventional but it does work. This PR changes __restore_stderr()__ to read that data from the same variable. Without this change, __restore_stderr()__ will probably raise a NameError at runtime because __stderr_backup__ is an undefined name. flake8 testing of https://github.com/lexelby/inkstitch on Python 2.7.14 $ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__ ``` ./embroider_params.py:748:18: F821 undefined name 'stderr_backup' sys.stderr = stderr_backup ^ ```
Diffstat (limited to 'embroider_params.py')
-rw-r--r--embroider_params.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/embroider_params.py b/embroider_params.py
index b0915ff2..7cba8fb0 100644
--- a/embroider_params.py
+++ b/embroider_params.py
@@ -745,7 +745,7 @@ def save_stderr():
def restore_stderr():
os.dup2(sys.stderr_dup, 2)
sys.stderr_backup.write(sys.stderr.getvalue())
- sys.stderr = stderr_backup
+ sys.stderr = sys.stderr_backup
# end of class MyFrame