Flip a last `MultiError` to a beg, add todo on `@stream` func

runtime_to_msgspec
Tyler Goodlet 2024-04-14 19:39:57 -04:00
parent 60aa16adf6
commit b209990d04
2 changed files with 6 additions and 3 deletions

View File

@ -246,10 +246,10 @@ def test_simple_context(
trio.run(main)
except error_parent:
pass
except trio.MultiError as me:
except BaseExceptionGroup as beg:
# XXX: on windows it seems we may have to expect the group error
from tractor._exceptions import is_multi_cancelled
assert is_multi_cancelled(me)
assert is_multi_cancelled(beg)
else:
trio.run(main)

View File

@ -38,10 +38,13 @@ async def async_gen_stream(sequence):
assert cs.cancelled_caught
# TODO: deprecated either remove entirely
# or re-impl in terms of `MsgStream` one-sides
# wrapper, but at least remove `Portal.open_stream_from()`
@tractor.stream
async def context_stream(
ctx: tractor.Context,
sequence
sequence: list[int],
):
for i in sequence:
await ctx.send_yield(i)