Kaydet (Commit) 3da3fcef authored tarafından Guido van Rossum's avatar Guido van Rossum

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

üst 91683285
...@@ -695,7 +695,7 @@ file_readlines(f, args) ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment