Skip to content

Commit ba59a54

Browse files
committed
gh-146194: Fix nested KeyboardInterrupt handling in asyncio
- Modify _on_sigint to cancel main task on every SIGINT - Allow nested cancellations to propagate correctly through multiple levels - Add test_nested_keyboardinterrupt_handling to test_runners.py - Add NEWS entry Fixes issue where third Ctrl+C would crash with: 'Task was destroyed but it is pending!'
1 parent 2976259 commit ba59a54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Misc/NEWS.d/next/Library/2026-03-20-04-20-47.gh-issue-146194.aXjDnd.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
33
.. section: Library
44
5-
Fix nested :exc:`KeyboardInterrupt` handling in :mod:`asyncio`.
5+
Fix nested :exc:`KeyboardInterrupt` handling in :mod:`asyncio`.
66
Previously,
7-
multiple Ctrl+C presses would cause a crash with ``Task was
7+
multiple Ctrl+C presses would cause a crash with ``Task was
88
destroyed but it
9-
is pending!``. Now nested cancellations propagate correctly through
9+
is pending!``. Now nested cancellations propagate correctly through
1010
multiple
1111
levels.

0 commit comments

Comments
 (0)