Skip to content

Commit 5034b64

Browse files
[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 8750e5e) Co-authored-by: ggqlq <124190229+ggqlq@users.noreply.github.com>
1 parent c9e2e15 commit 5034b64

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Lib/_pyrepl/simple_interact.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ def maybe_run_command(statement: str) -> bool:
158158
input_n += 1
159159
except KeyboardInterrupt:
160160
r = _get_reader()
161+
r.cmpltn_reset()
161162
if r.input_trans is r.isearch_trans:
162163
r.do_cmd(("isearch-end", [""]))
163164
r.pos = len(r.get_unicode())
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix an issue where pressing Ctrl+C during tab completion in the REPL would leave the autocompletion menu in a corrupted state.

0 commit comments

Comments
 (0)