]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (#97765)
authorhetmankp <728670+hetmankp@users.noreply.github.com>
Mon, 3 Oct 2022 20:34:35 +0000 (07:34 +1100)
committerGitHub <noreply@github.com>
Mon, 3 Oct 2022 20:34:35 +0000 (13:34 -0700)
commit3a49dbb98ccc1b90554ed181386316efa38adfba
treec1bee19994568f421a70243d6b9e4e480e2332ed
parent873a2f25272ca9fb027866a9730c44ba627b30cc
gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (#97765)

Ensure that the event loop's `_thread_id` attribute and the asyncgen hooks set by `sys.set_asyncgen_hooks()` are always restored no matter where a KeyboardInterrupt exception is raised.
Lib/asyncio/base_events.py