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
|
@ -134,7 +134,8 @@ class ReadlineAlikeReader(historical_reader.HistoricalReader, CompletingReader):
|
|||
return "".join(b[p + 1 : self.pos])
|
||||
|
||||
def get_completions(self, stem: str) -> list[str]:
|
||||
if module_completions := self.get_module_completions():
|
||||
module_completions = self.get_module_completions()
|
||||
if module_completions is not None:
|
||||
return module_completions
|
||||
if len(stem) == 0 and self.more_lines is not None:
|
||||
b = self.buffer
|
||||
|
@ -165,7 +166,7 @@ class ReadlineAlikeReader(historical_reader.HistoricalReader, CompletingReader):
|
|||
result.sort()
|
||||
return result
|
||||
|
||||
def get_module_completions(self) -> list[str]:
|
||||
def get_module_completions(self) -> list[str] | None:
|
||||
line = self.get_line()
|
||||
return self.config.module_completer.get_completions(line)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue