summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-01-11 19:28:55 (GMT)
committerGuido van Rossum <guido@python.org>1997-01-11 19:28:55 (GMT)
commitf22d7e2c69f9095edc2703483ec11a3b7ff931f5 (patch)
tree715e9f1733123e03897b3811bcd5b6b91348b672 /Modules/main.c
parent919cf1aff1b28d784fa91e31994875aa91a9ed55 (diff)
downloadcpython-f22d7e2c69f9095edc2703483ec11a3b7ff931f5.zip
cpython-f22d7e2c69f9095edc2703483ec11a3b7ff931f5.tar.gz
cpython-f22d7e2c69f9095edc2703483ec11a3b7ff931f5.tar.bz2
On Windows, -u implies binary mode for stdin/stdout
(as well as unbuffered stdout/stderr).
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c
index c8b583a..15d0cc5 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -162,6 +162,10 @@ main(argc, argv)
}
if (unbuffered) {
+#ifdef MS_WINDOWS
+ _setmode(stdin, O_BINARY);
+ _setmode(stdout, O_BINARY);
+#endif
#ifndef MPW
setbuf(stdout, (char *)NULL);
setbuf(stderr, (char *)NULL);