diff options
author | Guido van Rossum <guido@python.org> | 1997-04-11 22:19:12 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-04-11 22:19:12 (GMT) |
commit | b31c7dcb43307b57917150d60a64856d5a845fa7 (patch) | |
tree | 9895e845588354818e0a80354020897e433aadef | |
parent | 2a212191f8bd19c2deab88764b894dd31f39af78 (diff) | |
download | cpython-b31c7dcb43307b57917150d60a64856d5a845fa7.zip cpython-b31c7dcb43307b57917150d60a64856d5a845fa7.tar.gz cpython-b31c7dcb43307b57917150d60a64856d5a845fa7.tar.bz2 |
OK, I lied. On Windows, _IOLBF seems to be the same as full
buffering, so to get the normal behavior back, I set it to
unbuffered.
-rw-r--r-- | Modules/main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Modules/main.c b/Modules/main.c index 3057e46..23a910e 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -204,10 +204,14 @@ main(argc, argv) #endif } else if (Py_InteractiveFlag) { - char *ibuffer = malloc(BUFSIZ); - char *obuffer = malloc(BUFSIZ); - setvbuf(stdin, ibuffer, _IOLBF, BUFSIZ); - setvbuf(stdout, obuffer, _IOLBF, BUFSIZ); +#ifdef MS_WINDOWS + /* Doesn't have to have line-buffered -- use unbuffered */ + setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); + setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); +#else + setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); + setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); +#endif /* Leave stderr alone - it should be unbuffered anyway. */ } |