From 9a691c3c638281b91c4a53c10a609a16baa74b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Thu, 6 Feb 2014 11:36:42 +0100 Subject: [PATCH] Windows: Fixed sys.stdout and sys.stderr --- kcc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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__)))