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.
This commit is contained in:
Guido van Rossum 1997-04-11 22:19:12 +00:00
parent 2a212191f8
commit b31c7dcb43
1 changed files with 8 additions and 4 deletions

View File

@ -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. */
}