diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-03 16:58:19 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-03 16:58:19 (GMT) |
commit | faf9007d86a6ffa4a1f611fa1c3dd449f02cef56 (patch) | |
tree | fc6355eb95c041841ecd9bb6f5de931a7744e530 /Modules/_io/iobase.c | |
parent | 2be7ec38d117dbbfa8719ed532b6125aa15c162e (diff) | |
download | cpython-faf9007d86a6ffa4a1f611fa1c3dd449f02cef56.zip cpython-faf9007d86a6ffa4a1f611fa1c3dd449f02cef56.tar.gz cpython-faf9007d86a6ffa4a1f611fa1c3dd449f02cef56.tar.bz2 |
Merged revisions 80722 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r80722 | antoine.pitrou | 2010-05-03 18:48:20 +0200 (lun., 03 mai 2010) | 11 lines
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/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 271a41e..2d664ab 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -183,11 +183,7 @@ iobase_close(PyObject *self, PyObject *args) res = PyObject_CallMethodObjArgs(self, _PyIO_str_flush, NULL); PyObject_SetAttrString(self, "__IOBase_closed", Py_True); if (res == NULL) { - /* If flush() fails, just give up */ - if (PyErr_ExceptionMatches(PyExc_IOError)) - PyErr_Clear(); - else - return NULL; + return NULL; } Py_XDECREF(res); Py_RETURN_NONE; |