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.
........
This commit is contained in:
Antoine Pitrou 2010-05-03 16:48:20 +00:00
parent fb7b668216
commit 6be8876623
7 changed files with 81 additions and 32 deletions

View file

@ -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);