gh-120221: Support KeyboardInterrupt in asyncio REPL (#123795)

This switches the main pyrepl event loop to always be non-blocking so that it
can listen to incoming interruptions from other threads.

This also resolves invalid display of exceptions from other threads
(gh-123178).

This also fixes freezes with pasting and an active input hook.
This commit is contained in:
Łukasz Langa 2024-09-06 21:28:29 +02:00 committed by GitHub
parent 0c080d7c77
commit 033510e11d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 133 additions and 21 deletions

View file

@ -161,8 +161,8 @@ class FakeConsole(Console):
def forgetinput(self) -> None:
pass
def wait(self) -> None:
pass
def wait(self, timeout: float | None = None) -> bool:
return True
def repaint(self) -> None:
pass