summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/pylifecycle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 048c2b2..ec26824 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -302,9 +302,11 @@ initimport(PyInterpreterState *interp, PyObject *sysmod)
/* Install importlib as the implementation of import */
value = PyObject_CallMethod(importlib, "_install", "OO", sysmod, impmod);
- if (value != NULL)
+ if (value != NULL) {
+ Py_DECREF(value);
value = PyObject_CallMethod(importlib,
"_install_external_importers", "");
+ }
if (value == NULL) {
PyErr_Print();
Py_FatalError("Py_Initialize: importlib install failed");
@@ -325,6 +327,7 @@ initexternalimport(PyInterpreterState *interp)
PyErr_Print();
Py_FatalError("Py_EndInitialization: external importer setup failed");
}
+ Py_DECREF(value);
}