summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-04-29 19:16:30 (GMT)
committerGitHub <noreply@github.com>2018-04-29 19:16:30 (GMT)
commitc1a6832f50b36ffec299e6e6038535904e2b158d (patch)
tree3a249c12df193c9efafac4e5fac3c4a8332ed6a9 /Objects
parent55edd0c185ad2d895b5d73e47d67049bc156b654 (diff)
downloadcpython-c1a6832f50b36ffec299e6e6038535904e2b158d.zip
cpython-c1a6832f50b36ffec299e6e6038535904e2b158d.tar.gz
cpython-c1a6832f50b36ffec299e6e6038535904e2b158d.tar.bz2
bpo-33330: Write exceptions occurred in PyImport_Cleanup() to stderr. (GH-6606)
They where silenced before.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/moduleobject.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 8fb368e..5fad447 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -603,8 +603,9 @@ _PyModule_ClearDict(PyObject *d)
else
PyErr_Clear();
}
- if (PyDict_SetItem(d, key, Py_None) != 0)
- PyErr_Clear();
+ if (PyDict_SetItem(d, key, Py_None) != 0) {
+ PyErr_WriteUnraisable(NULL);
+ }
}
}
}
@@ -623,8 +624,9 @@ _PyModule_ClearDict(PyObject *d)
else
PyErr_Clear();
}
- if (PyDict_SetItem(d, key, Py_None) != 0)
- PyErr_Clear();
+ if (PyDict_SetItem(d, key, Py_None) != 0) {
+ PyErr_WriteUnraisable(NULL);
+ }
}
}
}