mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Close issue #16163: handle submodules in pkgutil.iter_importers
This commit is contained in:
parent
8157459d6b
commit
c4e0d982f3
3 changed files with 44 additions and 2 deletions
|
@ -451,8 +451,8 @@ def iter_importers(fullname=""):
|
|||
if '.' in fullname:
|
||||
# Get the containing package's __path__
|
||||
pkg_name = fullname.rpartition(".")[0]
|
||||
pkg = importlib.import_module(pkg)
|
||||
path = getattr(sys.modules[pkg], '__path__', None)
|
||||
pkg = importlib.import_module(pkg_name)
|
||||
path = getattr(pkg, '__path__', None)
|
||||
if path is None:
|
||||
return
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue