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

@ -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)