(coro)
| 26 | |
| 27 | |
| 28 | def run_until_complete(coro): |
| 29 | exc = False |
| 30 | while True: |
| 31 | try: |
| 32 | if exc: |
| 33 | exc = False |
| 34 | fut = coro.throw(AwaitException) |
| 35 | else: |
| 36 | fut = coro.send(None) |
| 37 | except StopIteration as ex: |
| 38 | return ex.args[0] |
| 39 | |
| 40 | if fut == ('throw',): |
| 41 | exc = True |
| 42 | |
| 43 | |
| 44 | def to_list(gen): |