MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _cancel_all_tasks

Function _cancel_all_tasks

tools/python-3.11.9-amd64/Lib/asyncio/runners.py:193–211  ·  view source on GitHub ↗
(loop)

Source from the content-addressed store, hash-verified

191
192
193def _cancel_all_tasks(loop):
194 to_cancel = tasks.all_tasks(loop)
195 if not to_cancel:
196 return
197
198 for task in to_cancel:
199 task.cancel()
200
201 loop.run_until_complete(tasks.gather(*to_cancel, return_exceptions=True))
202
203 for task in to_cancel:
204 if task.cancelled():
205 continue
206 if task.exception() is not None:
207 loop.call_exception_handler({
208 'message': 'unhandled exception during asyncio.run() shutdown',
209 'exception': task.exception(),
210 'task': task,
211 })

Callers 1

closeMethod · 0.85

Calls 6

gatherMethod · 0.80
cancelMethod · 0.45
run_until_completeMethod · 0.45
cancelledMethod · 0.45
exceptionMethod · 0.45

Tested by

no test coverage detected