gh-69605: Disable PyREPL module autocomplete fallback on regular completion (gh-134181)

Co-authored-by: Loïc Simon <loic.simon@napta.io>
This commit is contained in:
Loïc Simon 2025-05-26 01:05:08 +02:00 committed by GitHub
parent a32ea45699
commit 0e3bc962c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 12 deletions

View file

@ -42,11 +42,11 @@ class ModuleCompleter:
self._global_cache: list[pkgutil.ModuleInfo] = []
self._curr_sys_path: list[str] = sys.path[:]
def get_completions(self, line: str) -> list[str]:
def get_completions(self, line: str) -> list[str] | None:
"""Return the next possible import completions for 'line'."""
result = ImportParser(line).parse()
if not result:
return []
return None
try:
return self.complete(*result)
except Exception: