kopia lustrzana https://github.com/inkstitch/inkstitch
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 ^ ```pull/12/merge
rodzic
218ec1b63d
commit
ece8f15eda
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue