We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 623dbb1 commit f1bfafcCopy full SHA for f1bfafc
1 file changed
trio_asyncio/util.py
@@ -60,11 +60,13 @@ async def run_generator(loop, async_generator):
60
async def consume_next():
61
try:
62
item = await async_generator.__anext__()
63
+ result = trio.hazmat.Value(value=item)
64
except StopAsyncIteration:
- item = STOP
65
+ result = trio.hazmat.Value(value=STOP)
66
+ except Exception as e:
67
+ result = trio.hazmat.Error(error=e)
68
- trio.hazmat.reschedule(task, trio.hazmat.Value(value=item))
- #trio.hazmat.reschedule(task, STOP)
69
+ trio.hazmat.reschedule(task, result)
70
71
def abort_cb(raise_cancel_arg):
72
# Save the cancel-raising function
0 commit comments