]> git.cworth.org Git - apitrace/blobdiff - scripts/unpickle.py
Ensure stdin/stdout is in binary mode on windows when pickling.
[apitrace] / scripts / unpickle.py
index efb860804389ad7e5ccfae0a89171673c7bc1798..a3c274c8f593e34750be07905031bc6628fba7f9 100755 (executable)
@@ -52,6 +52,15 @@ def main():
     if args:
         optparser.error('unexpected arguments')
 
+    # Change stdin to binary mode
+    try:
+        import msvcrt
+    except ImportError:
+        pass
+    else:
+        import os
+        msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
+
     calls = 0
     startTime = time.time()
     while True: