mirror of
https://github.com/python/cpython.git
synced 2025-09-02 06:57:58 +00:00
Issue #22557: Now importing already imported modules is up to 2.5 times faster.
This commit is contained in:
parent
cde03fa038
commit
133138a284
6 changed files with 244 additions and 252 deletions
|
@ -254,6 +254,11 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
|
|||
interp->importlib = importlib;
|
||||
Py_INCREF(interp->importlib);
|
||||
|
||||
interp->import_func = PyDict_GetItemString(interp->builtins, "__import__");
|
||||
if (interp->import_func == NULL)
|
||||
Py_FatalError("Py_Initialize: __import__ not found");
|
||||
Py_INCREF(interp->import_func);
|
||||
|
||||
/* Import the _imp module */
|
||||
impmod = PyInit_imp();
|
||||
if (impmod == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue