From d84bc5c682ff2d532d6315707cbf91638dbc840d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 26 Feb 2020 13:48:27 +0100 Subject: [PATCH] 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. --- cura_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura_app.py b/cura_app.py index 38d1149080..2358108845 100755 --- a/cura_app.py +++ b/cura_app.py @@ -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