diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2013-12-19 06:35:15 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2013-12-19 06:35:15 (GMT) |
commit | 61e851baca37e81f60754e943f11b856e9fbef6e (patch) | |
tree | 20221ffae969f100ad05a2082ceb24965232f8b5 /Lib/importlib | |
parent | fc45f173a3485b024a96f6e891db08efdaf34722 (diff) | |
download | cpython-61e851baca37e81f60754e943f11b856e9fbef6e.zip cpython-61e851baca37e81f60754e943f11b856e9fbef6e.tar.gz cpython-61e851baca37e81f60754e943f11b856e9fbef6e.tar.bz2 |
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. :)
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index baa6c16..efe62d4 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -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 |