Skip to content

Commit

Permalink
Tweak log msg
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Sep 24, 2020
1 parent 6cd29f8 commit 4059c2f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tractor/to_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def cancel_trio(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)
Expand All @@ -116,13 +116,15 @@ async def stream_results():

# simple async func
elif inspect.iscoroutine(coro):

with cancel_scope:
# return single value
return await from_aio.receive()
if cancel_scope.cancelled_caught and err:
raise err



def run_as_asyncio_guest(
trio_main: Callable,
) -> None:
Expand Down

0 comments on commit 4059c2f

Please sign in to comment.