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

Function run_async__await__

Lib/test/test_coroutines.py:56–72  ·  view source on GitHub ↗
(coro)

Source from the content-addressed store, hash-verified

54
55
56def run_async__await__(coro):
57 assert coro.__class__ is types.CoroutineType
58 aw = coro.__await__()
59 buffer = []
60 result = None
61 i = 0
62 while True:
63 try:
64 if i % 2:
65 buffer.append(next(aw))
66 else:
67 buffer.append(aw.send(None))
68 i += 1
69 except StopIteration as ex:
70 result = ex.args[0] if ex.args else None
71 break
72 return buffer, result
73
74
75@contextlib.contextmanager

Callers 4

test_func_1Method · 0.85
test_await_3Method · 0.85

Calls 3

__await__Method · 0.45
appendMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…