Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0dfbaf

Browse files
committed
Patch #698082 from Thomas Heller: Modulefinder didn't exclude modules
in packages correctly.
1 parent 62442c2 commit f0dfbaf

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/modulefinder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def import_module(self, partname, fqname, parent):
242242
return None
243243
try:
244244
fp, pathname, stuff = self.find_module(partname,
245-
parent and parent.__path__)
245+
parent and parent.__path__, parent)
246246
except ImportError:
247247
self.msgout(3, "import_module ->", None)
248248
return None
@@ -385,9 +385,9 @@ def add_module(self, fqname):
385385
self.modules[fqname] = m = Module(fqname)
386386
return m
387387

388-
def find_module(self, name, path):
389-
if path:
390-
fullname = '.'.join(path)+'.'+name
388+
def find_module(self, name, path, parent=None):
389+
if parent is not None:
390+
fullname = parent.__name__+'.'+name
391391
else:
392392
fullname = name
393393
if fullname in self.excludes:

0 commit comments

Comments
 (0)