MCPcopy Index your code
hub / github.com/python/cpython / task_done

Function task_done

Lib/asyncio/staggered.py:75–91  ·  view source on GitHub ↗
(task)

Source from the content-addressed store, hash-verified

73 on_completed_fut = None
74
75 def task_done(task):
76 running_tasks.discard(task)
77 futures.future_discard_from_awaited_by(task, parent_task)
78 if (
79 on_completed_fut is not None
80 and not on_completed_fut.done()
81 and not running_tasks
82 ):
83 on_completed_fut.set_result(None)
84
85 if task.cancelled():
86 return
87
88 exc = task.exception()
89 if exc is None:
90 return
91 unhandled_exceptions.append(exc)
92
93 async def run_one_coro(ok_to_start, previous_failed) -> None:
94 # in eager tasks this waits for the calling task to append this task

Callers

nothing calls this directly

Calls 6

discardMethod · 0.45
doneMethod · 0.45
set_resultMethod · 0.45
cancelledMethod · 0.45
exceptionMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…