diff options
author | Victor Stinner <vstinner@python.org> | 2023-05-31 11:41:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 11:41:19 (GMT) |
commit | 58a2e0981642dcddf49daa776ff68a43d3498cee (patch) | |
tree | 3dd438b025dc884fecf9f850f19eda79d4fa9f8f /Modules | |
parent | 85e5d03163cac106ac8ec142ef03f1349a48948b (diff) | |
download | cpython-58a2e0981642dcddf49daa776ff68a43d3498cee.zip cpython-58a2e0981642dcddf49daa776ff68a43d3498cee.tar.gz cpython-58a2e0981642dcddf49daa776ff68a43d3498cee.tar.bz2 |
gh-62948: IOBase finalizer logs close() errors (#105104)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_io/iobase.c | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index bcb498d..f98e75c 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -319,20 +319,8 @@ iobase_finalize(PyObject *self) if (PyObject_SetAttr(self, &_Py_ID(_finalizing), Py_True)) PyErr_Clear(); res = PyObject_CallMethodNoArgs((PyObject *)self, &_Py_ID(close)); - /* Silencing I/O errors is bad, but printing spurious tracebacks is - equally as bad, and potentially more frequent (because of - shutdown issues). */ if (res == NULL) { -#ifndef Py_DEBUG - if (_Py_GetConfig()->dev_mode) { - PyErr_WriteUnraisable(self); - } - else { - PyErr_Clear(); - } -#else PyErr_WriteUnraisable(self); -#endif } else { Py_DECREF(res); |