Browse Source

Capture stdout and stderr on Windows to prevent py2exe messages

CURA-215 #done
Arjen Hiemstra 9 years ago
parent
commit
9b119e996a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      cura_app.py

+ 5 - 0
cura_app.py

@@ -13,5 +13,10 @@ sys.excepthook = exceptHook
 
 import cura.CuraApplication
 
+if sys.platform == "win32" and hasattr(sys, "frozen"):
+    from UM.Resources import Resources
+    sys.stdout = open(Resources.getPath(Resources.Resources, "stdout.log"), "w")
+    sys.stderr = open(Resources.getPath(Resources.Resources, "stderr.log"), "w")
+
 app = cura.CuraApplication.CuraApplication.getInstance()
 app.run()