Commit 7cf196eb authored by Eric Snow's avatar Eric Snow

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. :)
parent 5f9dfae1
......@@ -1934,15 +1934,10 @@ class FileFinder:
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
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment