Minor refactor for readability

Time: 5.73s => 5.88s/5.82s
This commit is contained in:
Anders Hovmöller
2018-10-25 15:16:10 +02:00
committed by Daniel Hahler
parent a41820fbf0
commit 2b50911c9d
2 changed files with 11 additions and 4 deletions

View File

@@ -563,6 +563,10 @@ class Package(Module):
yield Module(init_module, self)
pkg_prefixes = set()
for path in this_path.visit(rec=self._recurse, bf=True, sort=True):
# We will visit our own __init__.py file, in which case we skip it.
if path.isfile():
if path.basename == "__init__.py" and path.dirpath() == this_path:
continue
parts_ = parts(path.strpath)
if any(