Also check if streams are not closed

SmartAvionics found that this was a safer way to be able to write to these streams.

See comments on commit 2eab2c0f3dbe3153cc704ca9e396cd78b0ebbf9d.
This commit is contained in:
Ghostkeeper 2020-02-26 13:48:27 +01:00
parent 7e2177a8cd
commit d84bc5c682
No known key found for this signature in database
GPG Key ID: 37E2020986774393

View File

@ -170,9 +170,9 @@ def exceptHook(hook_type, value, traceback):
# Set exception hook to use the crash dialog handler
sys.excepthook = exceptHook
# Enable dumping traceback for all threads
if sys.stderr:
if sys.stderr and not sys.stderr.closed:
faulthandler.enable(file = sys.stderr, all_threads = True)
elif sys.stdout:
elif sys.stdout and not sys.stdout.closed:
faulthandler.enable(file = sys.stdout, all_threads = True)
from cura.CuraApplication import CuraApplication