1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-13 09:46:25 +00:00

Windows: Fixed sys.stdout and sys.stderr

This commit is contained in:
Paweł Jastrzębski
2014-02-06 11:36:42 +01:00
parent 2b04a0298e
commit 9a691c3c63

10
kcc.py
View File

@@ -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__)))