diff options
author | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-10-05 19:32:44 +0300 |
---|---|---|
committer | Arjen Hiemstra <ahiemstra@heimr.nl> | 2015-10-05 19:32:44 +0300 |
commit | ba863526425e1c6092a65f16e8ba4f3c8b5bdb8f (patch) | |
tree | f8a6015234341040d4215cf922c39e3bd850f1b8 /cura_app.py | |
parent | 07d35a343906252585a2f2a2dadf6a1a00c85f4f (diff) |
Fix issues with crash handler and log file creation on Windows
Diffstat (limited to 'cura_app.py')
-rwxr-xr-x | cura_app.py | 8 |
1 files changed, 5 insertions, 3 deletions
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() |