mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-16 18:59:39 +08: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,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…
x
Reference in New Issue
Block a user