Refactor source and bytecode file loaders in importlib so that there

are source-only and source/bytecode loaders.
This commit is contained in:
Brett Cannon 2009-02-21 05:41:15 +00:00
parent 0515619dbc
commit 91cf882b36
4 changed files with 163 additions and 149 deletions

View file

@ -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)