Skip to content
Merged
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
Prev Previous commit
Next Next commit
revert skipping _set_task_name if name is None; fix typo in comment
  • Loading branch information
itamaro committed May 5, 2023
commit 161d0f8c6f0241bb20f887522659b1bc8700452d
5 changes: 2 additions & 3 deletions Lib/asyncio/taskgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,8 @@ def create_task(self, coro, *, name=None, context=None):
task = self._loop.create_task(coro)
else:
task = self._loop.create_task(coro, context=context)
if name is not None:
tasks._set_task_name(task, name)
# optimization: Immediately call the done callback is the task is
tasks._set_task_name(task, 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
if task.done():
Expand Down