From d25049ca6bdc0c47b2fac8b696e357bcab206c1b 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: