mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Issue #23911: Move path-based bootstrap code to a separate frozen module.
This commit is contained in:
parent
6b4c63dea5
commit
32439d6eb6
27 changed files with 6192 additions and 5712 deletions
|
@ -53,6 +53,7 @@ Richard Chamberlain, for the first implementation of textdoc.
|
|||
|
||||
import builtins
|
||||
import importlib._bootstrap
|
||||
import importlib._bootstrap_external
|
||||
import importlib.machinery
|
||||
import importlib.util
|
||||
import inspect
|
||||
|
@ -292,9 +293,9 @@ def importfile(path):
|
|||
filename = os.path.basename(path)
|
||||
name, ext = os.path.splitext(filename)
|
||||
if is_bytecode:
|
||||
loader = importlib._bootstrap.SourcelessFileLoader(name, path)
|
||||
loader = importlib._bootstrap_external.SourcelessFileLoader(name, path)
|
||||
else:
|
||||
loader = importlib._bootstrap.SourceFileLoader(name, path)
|
||||
loader = importlib._bootstrap_external.SourceFileLoader(name, path)
|
||||
# XXX We probably don't need to pass in the loader here.
|
||||
spec = importlib.util.spec_from_file_location(name, path, loader=loader)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue