From 3da3fcef961c4be22806d9d94df5f1d0f09dbbc7 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Thu, 19 Feb 1998 20:46:48 +0000 Subject: [PATCH] Check ferror(), not errno, for fread() error. --- Objects/fileobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/fileobject.c b/Objects/fileobject.c index cd8a7309540..5502f156ff6 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -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);