[3.14] gh-134869: Fix Ctrl+C corrupts REPL autocomplete (GH-134929) (#137926)

gh-134869: Fix Ctrl+C corrupts REPL  autocomplete (GH-134929)
(cherry picked from commit 8750e5ecfc)

Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-08-18 23:21:55 +02:00 committed by GitHub
parent c9e2e15438
commit 5034b6491a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -158,6 +158,7 @@ def maybe_run_command(statement: str) -> bool:
input_n += 1
except KeyboardInterrupt:
r = _get_reader()
r.cmpltn_reset()
if r.input_trans is r.isearch_trans:
r.do_cmd(("isearch-end", [""]))
r.pos = len(r.get_unicode())