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

Method __wakeup

Lib/asyncio/tasks.py:359–374  ·  view source on GitHub ↗
(self, future)

Source from the content-addressed store, hash-verified

357 self = None # Needed to break cycles when an exception occurs.
358
359 def __wakeup(self, future):
360 futures.future_discard_from_awaited_by(future, self)
361 try:
362 future.result()
363 except BaseException as exc:
364 # This may also be a cancellation.
365 self.__step(exc)
366 else:
367 # Don't pass the value of `future.result()` explicitly,
368 # as `Future.__iter__` and `Future.__await__` don't need it.
369 # If we call `__step(value, None)` instead of `__step()`,
370 # Python eval loop would use `.send(value)` method call,
371 # instead of `__next__()`, which is slower for futures
372 # that return non-generator iterators from their `__iter__`.
373 self.__step()
374 self = None # Needed to break cycles when an exception occurs.
375
376
377_PyTask = Task

Callers

nothing calls this directly

Calls 2

__stepMethod · 0.95
resultMethod · 0.45

Tested by

no test coverage detected