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:
10
kcc.py
10
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__)))
|
||||
|
||||
Reference in New Issue
Block a user