Skip to content

Commit f983834

Browse files
authored
Update Lib/asyncio/taskgroups.py
1 parent 98b6d01 commit f983834

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/asyncio/taskgroups.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ def create_task(self, coro, *, name=None, context=None):
206206
self._tasks.add(task)
207207
task.add_done_callback(self._on_task_done)
208208
if self._aborting:
209+
# gh-128550: if this task is eager it might have started
210+
# another eager task that aborts us, if so we must cancel
211+
# this task.
209212
task.cancel()
210213
return task
211214

0 commit comments

Comments
 (0)