diff --git a/cura/CrashHandler.py b/cura/CrashHandler.py index 99220c2378..b369717f79 100644 --- a/cura/CrashHandler.py +++ b/cura/CrashHandler.py @@ -5,14 +5,13 @@ import webbrowser from PyQt5.QtCore import QT_VERSION_STR, PYQT_VERSION_STR, QCoreApplication from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QVBoxLayout, QLabel, QTextEdit -from UM.Application import Application from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") debug_mode = False def show(exception_type, value, tb): - if Application.getInstance().getCommandLineOption("debug-mode", False): + if QCoreApplication.instance() and QCoreApplication.instance().getCommandLineOption("debug-mode", False): debug_mode = True traceback.print_exception(exception_type, value, tb) diff --git a/cura_app.py b/cura_app.py index ee8211f818..e71fbd6515 100755 --- a/cura_app.py +++ b/cura_app.py @@ -14,9 +14,11 @@ sys.excepthook = exceptHook import cura.CuraApplication if sys.platform == "win32" and hasattr(sys, "frozen"): - import os.path - sys.stdout = open(os.path.expanduser("~/AppData/Local/cura/stdout.log"), "w") - sys.stderr = open(os.path.expanduser("~/AppData/Local/cura/stderr.log"), "w") + import os + dirpath = os.path.expanduser("~/AppData/Local/cura/") + os.makedirs(dirpath, exist_ok = True) + sys.stdout = open(os.path.join(dirpath, "stdout.log"), "w") + sys.stderr = open(os.path.join(dirpath, "stderr.log"), "w") app = cura.CuraApplication.CuraApplication.getInstance() app.run()