diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-04-14 12:30:42 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-04-14 12:30:42 (GMT) |
commit | c4e0d982f3b967973553c99722b1e4002c8b35f6 (patch) | |
tree | 254a3f22bc8bfe92f268a95c73ca8fd9423af3c6 /Lib/pkgutil.py | |
parent | 8157459d6b39bff7a8d6ffdfb66175d74dde1448 (diff) | |
download | cpython-c4e0d982f3b967973553c99722b1e4002c8b35f6.zip cpython-c4e0d982f3b967973553c99722b1e4002c8b35f6.tar.gz cpython-c4e0d982f3b967973553c99722b1e4002c8b35f6.tar.bz2 |
Close issue #16163: handle submodules in pkgutil.iter_importers
Diffstat (limited to 'Lib/pkgutil.py')
-rw-r--r-- | Lib/pkgutil.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py index a5de04d..20e6498 100644 --- a/Lib/pkgutil.py +++ b/Lib/pkgutil.py @@ -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: |