Browse Source

Enable the Python faulthandler

This will print a Python backtrace to stderr when SIGSEGV and similar
crashes happen. Hopefully it should help a bit when debugging those.
Arjen Hiemstra 7 years ago
parent
commit
fafb83c5c4
1 changed files with 3 additions and 0 deletions
  1. 3 0
      cura_app.py

+ 3 - 0
cura_app.py

@@ -5,6 +5,7 @@
 import os
 import sys
 import platform
+import faulthandler
 
 from UM.Platform import Platform
 
@@ -59,6 +60,8 @@ if hasattr(sys, "frozen"):
     sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w")
     sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w")
 
+faulthandler.enable()
+
 # Force an instance of CuraContainerRegistry to be created and reused later.
 cura.Settings.CuraContainerRegistry.CuraContainerRegistry.getInstance()