From 0168a1d5e0fe3b395952fac673d16f7f9a0a22e3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 25 Oct 2019 14:12:55 +0200 Subject: 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. --- cura_app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cura_app.py') 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 -- cgit v1.2.3