Address #3796 and add a test for it.

This commit is contained in:
turturica
2018-08-23 22:48:44 -07:00
parent 4d3c1ab4f0
commit 5f8b50c094
2 changed files with 75 additions and 5 deletions

View File

@@ -597,14 +597,16 @@ class Package(Module):
if path.basename == "__init__.py" and path.dirpath() == this_path:
continue
for pkg_prefix in pkg_prefixes:
if pkg_prefix in path.parts() and pkg_prefix.join('__init__.py') != path:
skip = True
if skip:
continue
if path.isdir() and path.join('__init__.py').check(file=1):
pkg_prefixes.add(path)
for pkg_prefix in pkg_prefixes:
if pkg_prefix in path.parts() and pkg_prefix.join('__init__.py') == path:
skip = True
if skip:
continue
for x in self._collectfile(path):
yield x