mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
Better convey intent
This commit is contained in:
parent
48fd43f8e8
commit
7ac428e9c4
1 changed files with 2 additions and 2 deletions
|
|
@ -110,7 +110,7 @@ def _find_modules(self, path: str, prefix: str) -> list[str]:
|
|||
modules: Iterable[pkgutil.ModuleInfo]
|
||||
imported_module = sys.modules.get(path.split('.')[0])
|
||||
if imported_module:
|
||||
# Module already imported: only look for its submodules,
|
||||
# Module already imported: only look in its location,
|
||||
# even if a module with the same name would be higher in path
|
||||
imported_path = (imported_module.__spec__
|
||||
and imported_module.__spec__.origin)
|
||||
|
|
@ -122,7 +122,7 @@ def _find_modules(self, path: str, prefix: str) -> list[str]:
|
|||
else:
|
||||
# Module already imported but without spec/origin:
|
||||
# propose no suggestions
|
||||
modules = []
|
||||
return []
|
||||
else:
|
||||
modules = self.global_cache
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue