diff options
Diffstat (limited to 'Parser/myreadline.c')
-rw-r--r-- | Parser/myreadline.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c index a62e208..7166fc1 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -36,7 +36,7 @@ static int my_fgets(char *buf, int len, FILE *fp) { char *p; - for (;;) { + while (1) { if (PyOS_InputHook != NULL) (void)(PyOS_InputHook)(); errno = 0; @@ -85,9 +85,10 @@ my_fgets(char *buf, int len, FILE *fp) #ifdef WITH_THREAD PyEval_SaveThread(); #endif - if (s < 0) { - return 1; - } + if (s < 0) + return 1; + /* try again */ + continue; } #endif if (PyOS_InterruptOccurred()) { |