summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-30 21:47:01 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-30 21:47:01 (GMT)
commit0c9f31b4c0d9bc910a7a4fce453a9768f2c9441b (patch)
tree9baeb22447387477b875ef010b764b054e4e00fd /Parser
parentf47fa58b62e6702f840625bff9fc8a07cef3408f (diff)
parent4f71101eeda6fb0b55805ebcb12d11124ab3b567 (diff)
downloadcpython-0c9f31b4c0d9bc910a7a4fce453a9768f2c9441b.zip
cpython-0c9f31b4c0d9bc910a7a4fce453a9768f2c9441b.tar.gz
cpython-0c9f31b4c0d9bc910a7a4fce453a9768f2c9441b.tar.bz2
(Merge 3.2) 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 b12d052..fb4b805 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -40,6 +40,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 */