mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Check ferror(), not errno, for fread() error.
This commit is contained in:
parent
9168328572
commit
3da3fcef96
1 changed files with 1 additions and 1 deletions
|
@ -695,7 +695,7 @@ file_readlines(f, args)
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
if (nread == 0) {
|
if (nread == 0) {
|
||||||
sizehint = 0;
|
sizehint = 0;
|
||||||
if (nread == 0)
|
if (!ferror(f->f_fp))
|
||||||
break;
|
break;
|
||||||
PyErr_SetFromErrno(PyExc_IOError);
|
PyErr_SetFromErrno(PyExc_IOError);
|
||||||
clearerr(f->f_fp);
|
clearerr(f->f_fp);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue