Skip to content

Commit

Permalink
pythongh-128550: TaskGroup: cancel tasks added to set after aborting
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Jan 6, 2025
1 parent f157485 commit 41929bd
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 41929bd

Please sign in to comment.