mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Merge for issue #20884
This commit is contained in:
commit
5d8a2444bf
1 changed files with 6 additions and 1 deletions
|
|
@ -22,7 +22,12 @@ else:
|
|||
# a second copy of the module.
|
||||
_bootstrap.__name__ = 'importlib._bootstrap'
|
||||
_bootstrap.__package__ = 'importlib'
|
||||
_bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')
|
||||
try:
|
||||
_bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')
|
||||
except NameError:
|
||||
# __file__ is not guaranteed to be defined, e.g. if this code gets
|
||||
# frozen by a tool like cx_Freeze.
|
||||
pass
|
||||
sys.modules['importlib._bootstrap'] = _bootstrap
|
||||
|
||||
# To simplify imports in test code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue