Skip to content

Commit 93d5c72

Browse files
gh-123856: Fix PyREPL failure when a keyboard interrupt is triggered after using a history search
1 parent 6203ef3 commit 93d5c72

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Lib/_pyrepl/simple_interact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def maybe_run_command(statement: str) -> bool:
159159
input_n += 1
160160
except KeyboardInterrupt:
161161
r = _get_reader()
162-
if r.last_command and 'isearch' in r.last_command.__name__:
162+
if r.input_trans is r.isearch_trans:
163163
r.isearch_direction = ''
164164
r.console.forgetinput()
165165
r.pop_input_trans()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix PyREPL failure when a keyboard interrupt is triggered after using a
2+
history search

0 commit comments

Comments
 (0)