fix unwanted CRLF conversion on windows

This commit is contained in:
erik.smit 2016-12-15 16:42:11 +01:00
parent 034e751d0b
commit 5d7efa2951

View file

@ -373,6 +373,9 @@ def main():
level=logging.DEBUG if args.debug else logging.INFO)
# Binary stdout (output data from device as-is)
if sys.platform == "win32":
import os, msvcrt
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
try: stdout_bin = sys.stdout.buffer
except: stdout_bin = sys.stdout