mirror of https://github.com/python/cpython
(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.
This commit is contained in:
commit
0c9f31b4c0
|
@ -10,6 +10,10 @@ What's New in Python 3.3 Alpha 1?
|
|||
Core and Builtins
|
||||
-----------------
|
||||
|
||||
- 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.
|
||||
|
||||
- Issue #12216: Allow unexpected EOF errors to happen on any line of the file.
|
||||
|
||||
- Issue #12199: The TryExcept and TryFinally and AST nodes have been unified
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue