From 61e851baca37e81f60754e943f11b856e9fbef6e Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Wed, 18 Dec 2013 23:35:15 -0700 Subject: 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. :) --- Lib/importlib/_bootstrap.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'Lib/importlib/_bootstrap.py') diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index baa6c162c6..efe62d4c4e 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 -- cgit v1.2.1