mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
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:
parent
a32ea45699
commit
0e3bc962c6
4 changed files with 27 additions and 12 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue