diff options
author | William Deegan <bill@baddogconsulting.com> | 2017-05-11 22:58:03 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2017-05-11 22:58:03 (GMT) |
commit | be4124b6555efd6660e0717e64b6fe9da68e6af2 (patch) | |
tree | 78a0ff5464de43a3b5aa9bb7c2017b9f4ec0b00e /test | |
parent | 0b7d17647ca37c3a3b1c510ace7b8212be9d916b (diff) | |
download | SCons-be4124b6555efd6660e0717e64b6fe9da68e6af2.zip SCons-be4124b6555efd6660e0717e64b6fe9da68e6af2.tar.gz SCons-be4124b6555efd6660e0717e64b6fe9da68e6af2.tar.bz2 |
py2/3 fix test for win32 set stdin and stdout to be binary mode
Diffstat (limited to 'test')
-rw-r--r-- | test/redirection.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/redirection.py b/test/redirection.py index ba35ed0..3394523 100644 --- a/test/redirection.py +++ b/test/redirection.py @@ -34,6 +34,13 @@ test.write('cat.py', r""" import sys PY3K = sys.version_info >= (3, 0) +# write binary to stdout +if sys.platform == "win32": + import os, msvcrt + msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) + msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) + + try: input = open(sys.argv[1], 'rb').read() except IndexError: |