Skip to content

[3.10] gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (GH-97765)#97793

Merged
miss-islington merged 1 commit intopython:3.10from
miss-islington:backport-3a49dbb-3.10
Oct 3, 2022
Merged

[3.10] gh-94732: Fix KeyboardInterrupt race in asyncio run_forever() (GH-97765)#97793
miss-islington merged 1 commit intopython:3.10from
miss-islington:backport-3a49dbb-3.10

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Oct 3, 2022

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.
(cherry picked from commit 3a49dbb)

Co-authored-by: hetmankp 728670+hetmankp@users.noreply.github.com