tests/get-with-headers.py
changeset 7054 e837f2294643
parent 5561 22713dce19f6
child 7544 c5e37dc38a52
--- a/tests/get-with-headers.py	Fri Sep 26 20:33:47 2008 +0200
+++ b/tests/get-with-headers.py	Sun Sep 28 20:40:38 2008 +0200
@@ -4,6 +4,14 @@
 a subset of the headers plus the body of the result."""
 
 import httplib, sys
+
+try:
+    import msvcrt, os
+    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
+    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+except ImportError:
+    pass
+
 headers = [h.lower() for h in sys.argv[3:]]
 conn = httplib.HTTPConnection(sys.argv[1])
 conn.request("GET", sys.argv[2])