summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-30 21:44:13 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-30 21:44:13 (GMT)
commit08563d904deac3b92418154b6116203adabdc61e (patch)
treed5c1a6cf1efb03663c7e60534702cb5945ef8638 /Parser
parentb0b64056d75f13f4e5d3f63b4e696ace05790ac7 (diff)
downloadcpython-08563d904deac3b92418154b6116203adabdc61e.zip
cpython-08563d904deac3b92418154b6116203adabdc61e.tar.gz
cpython-08563d904deac3b92418154b6116203adabdc61e.tar.bz2
Issue #12016: my_fgets() now always clears errors before calling fgets(). Fix
the following case: sys.stdin.read() stopped with CTRL+d (end of file), raw_input() interrupted by CTRL+c.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/myreadline.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index 34fb45c..07c1d44 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -44,6 +44,7 @@ my_fgets(char *buf, int len, FILE *fp)
if (PyOS_InputHook != NULL)
(void)(PyOS_InputHook)();
errno = 0;
+ clearerr(fp);
p = fgets(buf, len, fp);
if (p != NULL)
return 0; /* No error */