8000 gh-128550: TaskGroup: cancel tasks added to set after aborting by graingert · Pull Request #128551 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-128550: TaskGroup: cancel tasks added to set after aborting #128551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-128550: TaskGroup: cancel tasks added to set after aborting
  • Loading branch information
graingert committed Jan 6, 2025
commit 9726c3d31f4290c164fd0f8a05e4c739817d7256
2 changes: 2 additions & 0 deletions Lib/asyncio/taskgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ def create_task(self, coro, *, name=None, context=None):
else:
self._tasks.add(task)
task.add_done_callback(self._on_task_done)
if self._aborting:
task.cancel()
return task

# Since Python 3.8 Tasks propagate all exceptions correctly,
Expand Down
Loading
0