From 0f505bd6ddef9e1b5a85a3bde65a9d30913521d3 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 24 Sep 2020 10:15:29 -0400 Subject: [PATCH] Tweak log msg --- tractor/to_asyncio.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tractor/to_asyncio.py b/tractor/to_asyncio.py index f9cdada..59db280 100644 --- a/tractor/to_asyncio.py +++ b/tractor/to_asyncio.py @@ -95,7 +95,7 @@ async def run_task( nonlocal err err = task.exception() if err: - log.exception("asyncio task errorred:") + log.exception(f"asyncio task errorred:\n{err}") cancel_scope.cancel() task.add_done_callback(cancel_trio) @@ -116,6 +116,7 @@ async def run_task( # simple async func elif inspect.iscoroutine(coro): + with cancel_scope: # return single value return await from_aio.receive() @@ -123,6 +124,7 @@ async def run_task( raise err + def run_as_asyncio_guest( trio_main: Callable, ) -> None: