diff options
-rw-r--r-- | Modules/main.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/main.c b/Modules/main.c index 0cab825..3057e46 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -203,9 +203,11 @@ main(argc, argv) setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ); #endif } - else if (stdin_is_interactive) { - setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); - setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); + else if (Py_InteractiveFlag) { + char *ibuffer = malloc(BUFSIZ); + char *obuffer = malloc(BUFSIZ); + setvbuf(stdin, ibuffer, _IOLBF, BUFSIZ); + setvbuf(stdout, obuffer, _IOLBF, BUFSIZ); /* Leave stderr alone - it should be unbuffered anyway. */ } |