From 08ff98963180e4c3aa8e7093a37b12b9d5916a16 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 13 Oct 2020 11:59:18 -0400 Subject: [PATCH] Add some comments --- tractor/_trionics.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tractor/_trionics.py b/tractor/_trionics.py index 2d57ac6..aecf16e 100644 --- a/tractor/_trionics.py +++ b/tractor/_trionics.py @@ -230,7 +230,7 @@ async def open_nursery() -> typing.AsyncGenerator[ActorNursery, None]: # after we yield upwards yield anursery log.debug( - f"Waiting on subactors {anursery._children}" + f"Waiting on subactors {anursery._children} " "to complete" ) except BaseException as err: @@ -274,6 +274,7 @@ async def open_nursery() -> typing.AsyncGenerator[ActorNursery, None]: # ria_nursery scope end + # XXX: do we need a `trio.Cancelled` catch here as well? except (Exception, trio.MultiError) as err: # If actor-local error was raised while waiting on # ".run_in_actor()" actors then we also want to cancel all @@ -295,6 +296,8 @@ async def open_nursery() -> typing.AsyncGenerator[ActorNursery, None]: if anursery._children: with trio.CancelScope(shield=True): await anursery.cancel() + + # use `MultiError` as needed if len(errors) > 1: raise trio.MultiError(tuple(errors.values())) else: