mirror of
https://github.com/michaelcmartin/Ophis.git
synced 2024-12-21 12:29:46 +00:00
Set STDOUT to binary mode on Windows if needed
This commit is contained in:
parent
ffd96a8c2f
commit
382a6a218b
@ -67,6 +67,12 @@ def run_all():
|
||||
outfile = Ophis.CmdLine.outfile
|
||||
if outfile == '-':
|
||||
output = sys.stdout
|
||||
if sys.platform == "win32":
|
||||
# We can't dump our binary in test mode; that would be
|
||||
# disastrous. So, we'll do some platform-specific
|
||||
# things here to force our stdout to binary mode.
|
||||
import os, msvcrt
|
||||
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
|
||||
elif outfile is None:
|
||||
output = file('ophis.bin', 'wb')
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user