tests/md5sum.py
changeset 7080 a6477aa893b8
parent 6470 ac0bcd951c2c
child 14494 1ffeeb91c55d
--- a/tests/md5sum.py	Sun Oct 12 19:11:56 2008 +0200
+++ b/tests/md5sum.py	Sun Oct 12 19:11:59 2008 +0200
@@ -6,13 +6,20 @@
 # of the PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2, which is
 # GPL-compatible.
 
-import sys
+import sys, os
 
 try:
     from hashlib import md5
 except ImportError:
     from md5 import md5
 
+try:
+    import msvcrt
+    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+except ImportError:
+    pass
+
 for filename in sys.argv[1:]:
     try:
         fp = open(filename, 'rb')