diff --git a/tractor/to_asyncio.py b/tractor/to_asyncio.py index c7bcc89..128f8d0 100644 --- a/tractor/to_asyncio.py +++ b/tractor/to_asyncio.py @@ -158,28 +158,15 @@ async def run_task( with cs: return await from_aio.receive() - if cs.cancelled_caught: - # always raise from any captured asyncio error - if from_aio._err: - raise from_aio._err - - # Do we need this? - except Exception as err: - - aio_err = from_aio._err - - if aio_err is not None: - # always raise from any captured asyncio error - raise err from aio_err - else: - raise - except trio.Cancelled: if not task.done(): task.cancel() - raise + finally: + if from_aio._err: + raise from_aio._err + # TODO: explicit api for the streaming case where # we pull from the mem chan in an async generator?