From: Kristján Valur Jónsson Date: Tue, 24 Mar 2009 13:51:36 +0000 (+0000) Subject: http://bugs.python.org/issue5544 X-Git-Tag: v3.1a2~215 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8915e0e43ac0c8a5c0c96b5a656062cc83188d7f;p=thirdparty%2FPython%2Fcpython.git http://bugs.python.org/issue5544 Fix to the last checkin, correctly raise an exception on failure. --- diff --git a/Modules/_fileio.c b/Modules/_fileio.c index 00065611e381..cc1cbeff5d7c 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c @@ -84,8 +84,10 @@ internal_close(PyFileIOObject *self) if (err < 0) save_errno = errno; Py_END_ALLOW_THREADS - } else - save_errno = errno; + } else { + save_errno = errno; + err = -1; + } } if (err < 0) { errno = save_errno;