diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-03 16:48:20 (GMT) |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-03 16:48:20 (GMT) |
| commit | 6be8876623ffab3f2d1e4af46e7ce169d84b35a6 (patch) | |
| tree | 66fdad672568ed51cbc8e1d598a104d4037381d2 /Modules/_io/bufferedio.c | |
| parent | fb7b66821678701c1847b2e950ddb6f061da27a2 (diff) | |
| download | cpython-6be8876623ffab3f2d1e4af46e7ce169d84b35a6.zip cpython-6be8876623ffab3f2d1e4af46e7ce169d84b35a6.tar.gz cpython-6be8876623ffab3f2d1e4af46e7ce169d84b35a6.tar.bz2 | |
Merged revisions 80720 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r80720 | antoine.pitrou | 2010-05-03 18:25:33 +0200 (lun., 03 mai 2010) | 5 lines
Issue #7865: The close() method of :mod:`io` objects should not swallow
exceptions raised by the implicit flush(). Also ensure that calling
close() several times is supported. Patch by Pascal Chambon.
........
Diffstat (limited to 'Modules/_io/bufferedio.c')
| -rw-r--r-- | Modules/_io/bufferedio.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index fb651a7..07fe0a1 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -440,11 +440,7 @@ buffered_close(buffered *self, PyObject *args) res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); ENTER_BUFFERED(self) if (res == NULL) { - /* If flush() fails, just give up */ - if (PyErr_ExceptionMatches(PyExc_IOError)) - PyErr_Clear(); - else - goto end; + goto end; } Py_XDECREF(res); |
