mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
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.
This commit is contained in:
parent
2abb9842d2
commit
0168a1d5e0
1 changed files with 5 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/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.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
|
@ -131,7 +131,10 @@ def exceptHook(hook_type, value, traceback):
|
||||||
# Set exception hook to use the crash dialog handler
|
# Set exception hook to use the crash dialog handler
|
||||||
sys.excepthook = exceptHook
|
sys.excepthook = exceptHook
|
||||||
# Enable dumping traceback for all threads
|
# 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
|
# Workaround for a race condition on certain systems where there
|
||||||
# is a race condition between Arcus and PyQt. Importing Arcus
|
# is a race condition between Arcus and PyQt. Importing Arcus
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue