From 9bb8a062ebb0108f5400135841ef7eb6d638badc Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 19 Nov 2018 08:47:42 -0500 Subject: [PATCH] mypy fixes --- tractor/_actor.py | 4 ++-- tractor/_portal.py | 2 +- tractor/_trionics.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tractor/_actor.py b/tractor/_actor.py index 671405d..ab3e434 100644 --- a/tractor/_actor.py +++ b/tractor/_actor.py @@ -357,10 +357,10 @@ class Actor: # (i.e. no cid was provided in the msg - see above). # Push this error to all local channel consumers # (normally portals) by marking the channel as errored - tb_str = msg.pop('tb_str') + tb_str = msg.get('tb_str') assert chan.uid exc = InternalActorError( - f"{self.channel.uid}\n" + tb_str, + f"{chan.uid}\n" + tb_str, **msg, ) chan._exc = exc diff --git a/tractor/_portal.py b/tractor/_portal.py index 83b8e13..28e28f4 100644 --- a/tractor/_portal.py +++ b/tractor/_portal.py @@ -60,7 +60,7 @@ class Portal: # when this is set to a tuple returned from ``_submit()`` then # it is expected that ``result()`` will be awaited at some point # during the portal's lifetime - self._result = None + self._result: Optional[Any] = None # set when _submit_for_result is called self._expect_result: Optional[ Tuple[str, Any, str, Dict[str, Any]] diff --git a/tractor/_trionics.py b/tractor/_trionics.py index a6c4b73..fb97468 100644 --- a/tractor/_trionics.py +++ b/tractor/_trionics.py @@ -222,7 +222,7 @@ class ActorNursery: log.debug(f"Waiting on all subactors to complete") children = self._children.copy() - errors = [] + errors: List[Exception] = [] # wait on run_in_actor() tasks, unblocks when all complete async with trio.open_nursery() as nursery: for subactor, proc, portal in children.values():