Remove some dead code in importlib, introduced with the PEP 451 patch.

Early in the PEP 451 implementation some of the importlib loaders had
their own _get_spec() methods to simplify accommodating them.  However,
later implementations removed the need.  They simply failed to remove
this code at the same time. :)
This commit is contained in:
Eric Snow 2013-12-18 23:35:15 -07:00
parent fc45f173a3
commit 61e851baca
2 changed files with 983 additions and 994 deletions

View file

@ -1934,15 +1934,10 @@ def find_loader(self, fullname):
return None, []
return spec.loader, spec.submodule_search_locations or []
def _get_spec(self, loader_class, fullname, path, submodule_search_locations, target):
def _get_spec(self, loader_class, fullname, path, smsl, target):
loader = loader_class(fullname, path)
try:
get_spec = loader._get_spec
except AttributeError:
return spec_from_file_location(fullname, path, loader=loader,
submodule_search_locations=submodule_search_locations)
else:
return get_spec(fullname, path, submodule_search_locations, target)
return spec_from_file_location(fullname, path, loader=loader,
submodule_search_locations=smsl)
def find_spec(self, fullname, target=None):
"""Try to find a loader for the specified module, or the namespace

File diff suppressed because it is too large Load diff