about summary refs log tree commit diff
path: root/kcc.py
diff options
context:
space:
mode:
authorPaweł Jastrzębski <pawelj@vulturis.eu>2014-02-06 11:36:42 +0100
committerPaweł Jastrzębski <pawelj@vulturis.eu>2014-02-06 11:45:37 +0100
commit9a691c3c638281b91c4a53c10a609a16baa74b20 (patch)
treeb0576dd7c0ac73de527d18238af7916e63bdceba /kcc.py
parentWindows: Fixed abnormalities with version check (diff)
downloadkcc-9a691c3c638281b91c4a53c10a609a16baa74b20.tar.gz
kcc-9a691c3c638281b91c4a53c10a609a16baa74b20.tar.bz2
kcc-9a691c3c638281b91c4a53c10a609a16baa74b20.zip
Windows: Fixed sys.stdout and sys.stderr
Diffstat (limited to 'kcc.py')
-rwxr-xr-xkcc.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kcc.py b/kcc.py
index 08c6925..f83fa61 100755
--- a/kcc.py
+++ b/kcc.py
@@ -78,6 +78,16 @@ if sys.platform.startswith('darwin'):
 elif sys.platform.startswith('win'):
     if getattr(sys, 'frozen', False):
         os.chdir(os.path.dirname(os.path.abspath(sys.executable)))
+
+        # Implementing dummy stdout and stderr for frozen Windows release
+        class fakestd(object):
+            def write(self, string):
+                pass
+
+            def flush(self):
+                pass
+        sys.stdout = fakestd()
+        sys.stderr = fakestd()
     else:
         os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + '/other/;' + os.environ['PATH']
         os.chdir(os.path.dirname(os.path.abspath(__file__)))