mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
Fix importlib.machinery.PathFinder.find_module() to essentially skip over None
entries in sys.path_importer_cache. While this differs from semantics in how __import__ works, it prevents any implicit semantics from taking hold with users.
This commit is contained in:
parent
0e314548c2
commit
8593a75688
2 changed files with 23 additions and 3 deletions
|
@ -661,9 +661,10 @@ class PathFinder:
|
|||
finder = cls._path_importer_cache(entry)
|
||||
except ImportError:
|
||||
continue
|
||||
loader = finder.find_module(fullname)
|
||||
if loader:
|
||||
return loader
|
||||
if finder:
|
||||
loader = finder.find_module(fullname)
|
||||
if loader:
|
||||
return loader
|
||||
else:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue