summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-08-02 19:51:21 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-08-02 19:51:21 (GMT)
commit133138a284be1985ebd9ec9014f1306b9a425d98 (patch)
tree15d5ad35ad76c65f88cb739100ff152194e96ef8 /Python/pystate.c
parentcde03fa0381fcb7f7d3ba0dff4e784eade1f3031 (diff)
downloadcpython-133138a284be1985ebd9ec9014f1306b9a425d98.zip
cpython-133138a284be1985ebd9ec9014f1306b9a425d98.tar.gz
cpython-133138a284be1985ebd9ec9014f1306b9a425d98.tar.bz2
Issue #22557: Now importing already imported modules is up to 2.5 times faster.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index ba4dd4c..b1aecec 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -90,6 +90,7 @@ PyInterpreterState_New(void)
interp->codecs_initialized = 0;
interp->fscodec_initialized = 0;
interp->importlib = NULL;
+ interp->import_func = NULL;
#ifdef HAVE_DLOPEN
#if HAVE_DECL_RTLD_NOW
interp->dlopenflags = RTLD_NOW;
@@ -128,6 +129,7 @@ PyInterpreterState_Clear(PyInterpreterState *interp)
Py_CLEAR(interp->builtins);
Py_CLEAR(interp->builtins_copy);
Py_CLEAR(interp->importlib);
+ Py_CLEAR(interp->import_func);
}