mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
Refactor source and bytecode file loaders in importlib so that there
are source-only and source/bytecode loaders.
This commit is contained in:
parent
0515619dbc
commit
91cf882b36
4 changed files with 163 additions and 149 deletions
|
@ -35,7 +35,7 @@ class EncodingTest(unittest.TestCase):
|
|||
with source_util.create_modules(self.module_name) as mapping:
|
||||
with open(mapping[self.module_name], 'wb')as file:
|
||||
file.write(source)
|
||||
loader = importlib._PyFileLoader(self.module_name,
|
||||
loader = importlib.PyPycFileLoader(self.module_name,
|
||||
mapping[self.module_name], False)
|
||||
return loader.load_module(self.module_name)
|
||||
|
||||
|
@ -96,7 +96,7 @@ class LineEndingTest(unittest.TestCase):
|
|||
with source_util.create_modules(module_name) as mapping:
|
||||
with open(mapping[module_name], 'wb') as file:
|
||||
file.write(source)
|
||||
loader = importlib._PyFileLoader(module_name, mapping[module_name],
|
||||
loader = importlib.PyPycFileLoader(module_name, mapping[module_name],
|
||||
False)
|
||||
return loader.load_module(module_name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue