mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
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.
This commit is contained in:
parent
7d9d25dbed
commit
3390347aa0
6 changed files with 4516 additions and 4559 deletions
|
@ -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__']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue