diff tests/run-tests.py @ 22120:68a7ef4311ce stable

run-tests: self-test on Windows needs binary streams
author Matt Mackall <mpm@selenic.com>
date Tue, 12 Aug 2014 11:02:30 -0500
parents c350cff58444
children a6eddeda93f3
line wrap: on
line diff
--- a/tests/run-tests.py	Tue Aug 12 02:40:42 2014 -0500
+++ b/tests/run-tests.py	Tue Aug 12 11:02:30 2014 -0500
@@ -1820,4 +1820,13 @@
 
 if __name__ == '__main__':
     runner = TestRunner()
+
+    try:
+        import msvcrt
+        msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+        msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+        msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+    except ImportError:
+        pass
+
     sys.exit(runner.run(sys.argv[1:]))