mirror of https://github.com/python/cpython
gh-119553: Fix console when pressing Ctrl-C within a multiline block (#120075)
This commit is contained in:
parent
4055577221
commit
69b3e8ea56
|
@ -216,11 +216,13 @@ class interrupt(FinishCommand):
|
|||
import signal
|
||||
|
||||
self.reader.console.finish()
|
||||
self.reader.finish()
|
||||
os.kill(os.getpid(), signal.SIGINT)
|
||||
|
||||
|
||||
class ctrl_c(Command):
|
||||
def do(self) -> None:
|
||||
self.reader.console.finish()
|
||||
self.reader.finish()
|
||||
raise KeyboardInterrupt
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ def run_multiline_interactive_console(
|
|||
assert not more
|
||||
input_n += 1
|
||||
except KeyboardInterrupt:
|
||||
console.write("\nKeyboardInterrupt\n")
|
||||
console.write("KeyboardInterrupt\n")
|
||||
console.resetbuffer()
|
||||
except MemoryError:
|
||||
console.write("\nMemoryError\n")
|
||||
|
|
Loading…
Reference in New Issue