diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-10-25 15:12:55 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-10-25 15:12:55 +0300 |
commit | 0168a1d5e0fe3b395952fac673d16f7f9a0a22e3 (patch) | |
tree | 1e6859623909c7b6b588e34fbeb7217c75ac307c | |
parent | 2abb9842d2ed75ca587fb7ed980bc5b7154f63a8 (diff) |
Don't output to stderr if there is no stderr
This can happen on Windows where the default command line doesn't have a stderr channel. Put it in stdout then.
Fixes #6579.
-rwxr-xr-x | cura_app.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cura_app.py b/cura_app.py index 080479ee92..e14b4410bc 100755 --- a/cura_app.py +++ b/cura_app.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import argparse @@ -131,7 +131,10 @@ def exceptHook(hook_type, value, traceback): # Set exception hook to use the crash dialog handler sys.excepthook = exceptHook # Enable dumping traceback for all threads -faulthandler.enable(all_threads = True) +if sys.stderr: + faulthandler.enable(file = sys.stderr, all_threads = True) +else: + faulthandler.enable(file = sys.stdout, all_threads = True) # Workaround for a race condition on certain systems where there # is a race condition between Arcus and PyQt. Importing Arcus |