Check ferror(), not errno, for fread() error.

This commit is contained in:
Guido van Rossum 1998-02-19 20:46:48 +00:00
parent 9168328572
commit 3da3fcef96

View File

@ -695,7 +695,7 @@ file_readlines(f, args)
Py_END_ALLOW_THREADS
if (nread == 0) {
sizehint = 0;
if (nread == 0)
if (!ferror(f->f_fp))
break;
PyErr_SetFromErrno(PyExc_IOError);
clearerr(f->f_fp);