aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/import.c b/Python/import.c
index 12f586abc2e..f37393bbdc4 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -395,8 +395,8 @@ remove_module(PyThreadState *tstate, PyObject *name)
PyObject *modules = MODULES(tstate->interp);
if (PyDict_CheckExact(modules)) {
- PyObject *mod = _PyDict_Pop(modules, name, Py_None);
- Py_XDECREF(mod);
+ // Error is reported to the caller
+ (void)PyDict_Pop(modules, name, NULL);
}
else if (PyMapping_DelItem(modules, name) < 0) {
if (_PyErr_ExceptionMatches(tstate, PyExc_KeyError)) {