summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-11-19 12:43:43 (GMT)
committerGitHub <noreply@github.com>2020-11-19 12:43:43 (GMT)
commit3390347aa036404453213d589fe1e35902e55fd4 (patch)
tree49309f502a12cfece7b30190f3f36a8ab1143d46 /Lib/importlib/_bootstrap.py
parent7d9d25dbedfffce61fc76bc7ccbfa9ae901bf56f (diff)
downloadcpython-3390347aa036404453213d589fe1e35902e55fd4.zip
cpython-3390347aa036404453213d589fe1e35902e55fd4.tar.gz
cpython-3390347aa036404453213d589fe1e35902e55fd4.tar.bz2
bpo-42403: Simplify importlib external bootstrap (GH-23397)
Simplify the importlib external bootstrap code: importlib._bootstrap_external now uses regular imports to import builtin modules. When it is imported, the builtin __import__() function is already fully working and so can be used to import builtin modules like sys.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r--Lib/importlib/_bootstrap.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index e00b27e..854b603 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -22,8 +22,15 @@ work. One should use importlib as the public-facing version of this module.
# Bootstrap-related code ######################################################
+# Modules injected manually by _setup()
+_thread = None
+_warnings = None
+_weakref = None
+
+# Import done by _install_external_importers()
_bootstrap_external = None
+
def _wrap(new, old):
"""Simple substitute for functools.update_wrapper."""
for replace in ['__module__', '__name__', '__qualname__', '__doc__']: