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

Method callback

Lib/asyncio/streams.py:241–252  ·  view source on GitHub ↗
(task)

Source from the content-addressed store, hash-verified

239 res = self._client_connected_cb(reader, writer)
240 if coroutines.iscoroutine(res):
241 def callback(task):
242 if task.cancelled():
243 transport.close()
244 return
245 exc = task.exception()
246 if exc is not None:
247 self._loop.call_exception_handler({
248 'message': 'Unhandled exception in client_connected_cb',
249 'exception': exc,
250 'transport': transport,
251 })
252 transport.close()
253
254 self._task = self._loop.create_task(res)
255 self._task.add_done_callback(callback)

Callers

nothing calls this directly

Calls 4

cancelledMethod · 0.45
closeMethod · 0.45
exceptionMethod · 0.45

Tested by

no test coverage detected