diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-10 00:22:59 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-10 00:22:59 +0200 |
commit | a5c3962c4b40d84039b9e48dbe82ed82712fde72 (patch) | |
tree | afa9d2ab17bc364f51bd9af6a32f79682cf5ab03 | |
parent | e3dc6fb9c89a5b998b4b97d61a20e6a72bcf3935 (diff) | |
download | cpython-a5c3962c4b40d84039b9e48dbe82ed82712fde72.tar.gz |
(Merge 3.1) Issue #1195: Fix input() if it is interrupted by CTRL+d and then
CTRL+c, clear the end-of-file indicator after CTRL+d.
-rw-r--r-- | Misc/NEWS | 3 | ||||
-rw-r--r-- | Parser/myreadline.c | 1 |
2 files changed, 4 insertions, 0 deletions
@@ -9,6 +9,9 @@ What's New in Python 2.7.2? Core and Builtins ----------------- +- Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c, + clear the end-of-file indicator after CTRL+d. + - Issue #8651: PyArg_Parse*() functions raise an OverflowError if the file doesn't have PY_SSIZE_T_CLEAN define and the size doesn't fit in an int (length bigger than 2^31-1 bytes). diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 8a76e0c23b..34fb45c932 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -77,6 +77,7 @@ my_fgets(char *buf, int len, FILE *fp) } #endif /* MS_WINDOWS */ if (feof(fp)) { + clearerr(fp); return -1; /* EOF */ } #ifdef EINTR |