summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-03-13 22:33:17 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-03-13 22:33:17 (GMT)
commit0ae29cf6176d3f80c1845cf23716a708acbe598b (patch)
treef6f6463670ede6c7e4ab0c15867bfe6c0764e3d8 /Modules
parent652e7076fee59d92d19a0d6e326b9069a2aa09e4 (diff)
downloadcpython-0ae29cf6176d3f80c1845cf23716a708acbe598b.zip
cpython-0ae29cf6176d3f80c1845cf23716a708acbe598b.tar.gz
cpython-0ae29cf6176d3f80c1845cf23716a708acbe598b.tar.bz2
The error detection code in FileIO.close() could fail to reflect the `errno` value, and report it as -1 instead.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_fileio.c4
1 files changed, 1 insertions, 3 deletions
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 @@ fileio_close(PyFileIOObject *self)
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);