mypy fixes

improved_errors
Tyler Goodlet 2018-11-19 08:47:42 -05:00
parent 835d1fa07a
commit 9bb8a062eb
3 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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]]

View File

@ -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():