Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9cf424b

Browse files
On Cygwin, put stdin, stderr, and stdout in binary mode when the -u
flag is given (to mimic native Windows).
1 parent d77f93a commit 9cf424b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "osdefs.h"
55
#include "compile.h" /* For CO_FUTURE_DIVISION */
66

7-
#ifdef MS_WINDOWS
7+
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
88
#include <fcntl.h>
99
#endif
1010

@@ -304,7 +304,7 @@ Py_Main(int argc, char **argv)
304304
stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0);
305305

306306
if (unbuffered) {
307-
#ifdef MS_WINDOWS
307+
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
308308
_setmode(fileno(stdin), O_BINARY);
309309
_setmode(fileno(stdout), O_BINARY);
310310
#endif

0 commit comments

Comments
 (0)