]> granicus.if.org Git - python/commitdiff
On Cygwin, put stdin, stderr, and stdout in binary mode when the -u
authorSjoerd Mullender <sjoerd@acm.org>
Fri, 9 Aug 2002 13:35:18 +0000 (13:35 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Fri, 9 Aug 2002 13:35:18 +0000 (13:35 +0000)
flag is given (to mimic native Windows).

Modules/main.c

index 9e467171b0e5dff82f329f01efa71404efc1d123..102693a5ca7e063ca6ccd0b5333e8fb36b44a570 100644 (file)
@@ -4,7 +4,7 @@
 #include "osdefs.h"
 #include "compile.h" /* For CO_FUTURE_DIVISION */
 
-#ifdef MS_WINDOWS
+#if defined(MS_WINDOWS) || defined(__CYGWIN__)
 #include <fcntl.h>
 #endif
 
@@ -304,7 +304,7 @@ Py_Main(int argc, char **argv)
        stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
 
        if (unbuffered) {
-#ifdef MS_WINDOWS
+#if defined(MS_WINDOWS) || defined(__CYGWIN__)
                _setmode(fileno(stdin), O_BINARY);
                _setmode(fileno(stdout), O_BINARY);
 #endif