Issue #14605: Expose importlib.abc.FileLoader and

importlib.machinery.(FileFinder, SourceFileLoader,
_SourcelessFileLoader, ExtensionFileLoader).

This exposes all of importlib's mechanisms that will become public on
the sys module.
This commit is contained in:
Brett Cannon 2012-04-22 19:58:33 -04:00
parent 8c5e920ae3
commit 938d44d59c
17 changed files with 3246 additions and 3076 deletions

View file

@ -35,7 +35,7 @@ def run_test(self, source):
with source_util.create_modules(self.module_name) as mapping:
with open(mapping[self.module_name], 'wb') as file:
file.write(source)
loader = _bootstrap._SourceFileLoader(self.module_name,
loader = _bootstrap.SourceFileLoader(self.module_name,
mapping[self.module_name])
return loader.load_module(self.module_name)
@ -97,7 +97,7 @@ def run_test(self, line_ending):
with source_util.create_modules(module_name) as mapping:
with open(mapping[module_name], 'wb') as file:
file.write(source)
loader = _bootstrap._SourceFileLoader(module_name,
loader = _bootstrap.SourceFileLoader(module_name,
mapping[module_name])
return loader.load_module(module_name)