commit | 0ae29cf6176d3f80c1845cf23716a708acbe598b | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Fri Mar 13 22:33:17 2009 +0000 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Fri Mar 13 22:33:17 2009 +0000 |
tree | f6f6463670ede6c7e4ab0c15867bfe6c0764e3d8 | |
parent | 652e7076fee59d92d19a0d6e326b9069a2aa09e4 [diff] |
The error detection code in FileIO.close() could fail to reflect the `errno` value, and report it as -1 instead.
diff --git a/Modules/_fileio.c b/Modules/_fileio.c index fd35d69..32f6790 100644 --- a/Modules/_fileio.c +++ b/Modules/_fileio.c
@@ -97,10 +97,8 @@ Py_RETURN_NONE; } errno = internal_close(self); - if (errno < 0) { - PyErr_SetFromErrno(PyExc_IOError); + if (errno < 0) return NULL; - } return PyObject_CallMethod((PyObject*)&PyRawIOBase_Type, "close", "O", self);