]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-120221: Support KeyboardInterrupt in asyncio REPL (#123795)
authorŁukasz Langa <lukasz@langa.pl>
Fri, 6 Sep 2024 19:28:29 +0000 (21:28 +0200)
committerGitHub <noreply@github.com>
Fri, 6 Sep 2024 19:28:29 +0000 (21:28 +0200)
commit033510e11dff742d9626b9fd895925ac77f566f1
tree312afe4e65696542145747bc525868fb1816a7d6
parent0c080d7c77d826c1afab7bd6b73f61e714cffcb7
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.
Lib/_pyrepl/_threading_handler.py [new file with mode: 0644]
Lib/_pyrepl/reader.py
Lib/_pyrepl/unix_console.py
Lib/_pyrepl/windows_console.py
Lib/asyncio/__main__.py
Lib/test/test_pyrepl/support.py
Lib/test/test_repl.py
Misc/NEWS.d/next/Core_and_Builtins/2024-09-06-19-23-44.gh-issue-120221.giJEDT.rst [new file with mode: 0644]