Skip to content

Commit 7ac428e

Browse files
committed
Better convey intent
1 parent 48fd43f commit 7ac428e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/_pyrepl/_module_completer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def _find_modules(self, path: str, prefix: str) -> list[str]:
110110
modules: Iterable[pkgutil.ModuleInfo]
111111
imported_module = sys.modules.get(path.split('.')[0])
112112
if imported_module:
113-
# Module already imported: only look for its submodules,
113+
# Module already imported: only look in its location,
114114
# even if a module with the same name would be higher in path
115115
imported_path = (imported_module.__spec__
116116
and imported_module.__spec__.origin)
@@ -122,7 +122,7 @@ def _find_modules(self, path: str, prefix: str) -> list[str]:
122122
else:
123123
# Module already imported but without spec/origin:
124124
# propose no suggestions
125-
modules = []
125+
return []
126126
else:
127127
modules = self.global_cache
128128

0 commit comments

Comments
 (0)