Merge pull request #4251 from blueyed/python-collect
python: collect: revisit
This commit is contained in:
		
						commit
						e986d06ade
					
				|  | @ -560,19 +560,16 @@ class Package(Module): | ||||||
|             yield Module(init_module, self) |             yield Module(init_module, self) | ||||||
|         pkg_prefixes = set() |         pkg_prefixes = set() | ||||||
|         for path in this_path.visit(rec=self._recurse, bf=True, sort=True): |         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 |             # We will visit our own __init__.py file, in which case we skip it. | ||||||
|             skip = False |             if path.isfile(): | ||||||
|                 if path.basename == "__init__.py" and path.dirpath() == this_path: |                 if path.basename == "__init__.py" and path.dirpath() == this_path: | ||||||
|                     continue |                     continue | ||||||
| 
 | 
 | ||||||
|             for pkg_prefix in pkg_prefixes: |             parts = path.parts() | ||||||
|                 if ( |             if any( | ||||||
|                     pkg_prefix in path.parts() |                 pkg_prefix in parts and pkg_prefix.join("__init__.py") != path | ||||||
|                     and pkg_prefix.join("__init__.py") != path |                 for pkg_prefix in pkg_prefixes | ||||||
|             ): |             ): | ||||||
|                     skip = True |  | ||||||
| 
 |  | ||||||
|             if skip: |  | ||||||
|                 continue |                 continue | ||||||
| 
 | 
 | ||||||
|             if path.isdir() and path.join("__init__.py").check(file=1): |             if path.isdir() and path.join("__init__.py").check(file=1): | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue