]> granicus.if.org Git - python/commitdiff
Check ferror(), not errno, for fread() error.
authorGuido van Rossum <guido@python.org>
Thu, 19 Feb 1998 20:46:48 +0000 (20:46 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 19 Feb 1998 20:46:48 +0000 (20:46 +0000)
Objects/fileobject.c

index cd8a730954037f105e446cb4a0d6cf173faf035e..5502f156ff68bd487ffd41329c1e156c8cab3d95 100644 (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);