mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-121295: Fix blocked console after interrupting a long paste (GH-121815)
This commit is contained in:
parent
7d111dac16
commit
498a94c198
2 changed files with 11 additions and 1 deletions
|
@ -157,7 +157,15 @@ def run_multiline_interactive_console(
|
||||||
assert not more
|
assert not more
|
||||||
input_n += 1
|
input_n += 1
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
console.write("KeyboardInterrupt\n")
|
r = _get_reader()
|
||||||
|
if r.last_command and 'isearch' in r.last_command.__name__:
|
||||||
|
r.isearch_direction = ''
|
||||||
|
r.console.forgetinput()
|
||||||
|
r.pop_input_trans()
|
||||||
|
r.dirty = True
|
||||||
|
r.refresh()
|
||||||
|
r.in_bracketed_paste = False
|
||||||
|
console.write("\nKeyboardInterrupt\n")
|
||||||
console.resetbuffer()
|
console.resetbuffer()
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
console.write("\nMemoryError\n")
|
console.write("\nMemoryError\n")
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix PyREPL console getting into a blocked state after interrupting a long
|
||||||
|
paste
|
Loading…
Add table
Add a link
Reference in a new issue