summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-05-31 11:41:19 (GMT)
committerGitHub <noreply@github.com>2023-05-31 11:41:19 (GMT)
commit58a2e0981642dcddf49daa776ff68a43d3498cee (patch)
tree3dd438b025dc884fecf9f850f19eda79d4fa9f8f /Modules
parent85e5d03163cac106ac8ec142ef03f1349a48948b (diff)
downloadcpython-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.c12
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);