GH-105684: Require asyncio.Task implementations to support set_name method (#105685)

This commit is contained in:
Kumar Aditya 2023-06-13 11:36:40 +05:30 committed by GitHub
parent 829ac13b69
commit 840d02f3f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 16 deletions

View file

@ -163,7 +163,7 @@ class TaskGroup:
task = self._loop.create_task(coro)
else:
task = self._loop.create_task(coro, context=context)
tasks._set_task_name(task, name)
task.set_name(name)
# optimization: Immediately call the done callback if the task is
# already done (e.g. if the coro was able to complete eagerly),
# and skip scheduling a done callback