Commit ab1cb80b authored by Stéphane Wirtel's avatar Stéphane Wirtel Committed by Victor Stinner

bpo-30547: Fix multiple reference leaks (#1995)

Fix regressions introduced by:

- bpo-22257: commits 1abcf670 and 6b4be195Co-Authored-By: default avatarVictor Stinner <victor.stinner@gmail.com>
Co-Authored-By: default avatarLouie Lu <git@louie.lu>
parent 65ece7ca
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment