Patch #512981: Update readline input stream on sys.stdin/out change.

This commit is contained in:
Martin v. Löwis 2002-10-26 14:39:10 +00:00
parent 88afe666da
commit 566f6afe9a
5 changed files with 42 additions and 22 deletions

View file

@ -18,7 +18,7 @@
#include "abstract.h"
#endif /* PGEN */
extern char *PyOS_Readline(char *);
extern char *PyOS_Readline(FILE *, FILE *, char *);
/* Return malloc'ed string including trailing \n;
empty malloc'ed string for EOF;
NULL if interrupted */
@ -671,7 +671,7 @@ tok_nextc(register struct tok_state *tok)
return Py_CHARMASK(*tok->cur++);
}
if (tok->prompt != NULL) {
char *new = PyOS_Readline(tok->prompt);
char *new = PyOS_Readline(stdin, stdout, tok->prompt);
if (tok->nextprompt != NULL)
tok->prompt = tok->nextprompt;
if (new == NULL)