From f72b97234810ad0d529eb08c1c93cc4323666330 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sun, 14 Apr 2024 17:49:18 -0400 Subject: [PATCH] Hide `._entry`/`._child` frames, tweak some more type annots --- tractor/_child.py | 1 + tractor/_entry.py | 1 + tractor/_spawn.py | 2 +- tractor/_supervise.py | 10 +++++----- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tractor/_child.py b/tractor/_child.py index bd1e830..4226ae9 100644 --- a/tractor/_child.py +++ b/tractor/_child.py @@ -36,6 +36,7 @@ def parse_ipaddr(arg): if __name__ == "__main__": + __tracebackhide__: bool = True parser = argparse.ArgumentParser() parser.add_argument("--uid", type=parse_uid) diff --git a/tractor/_entry.py b/tractor/_entry.py index b2aae2e..bf719ab 100644 --- a/tractor/_entry.py +++ b/tractor/_entry.py @@ -106,6 +106,7 @@ def _trio_main( Entry point for a `trio_run_in_process` subactor. ''' + __tracebackhide__: bool = True _state._current_actor = actor trio_main = partial( async_main, diff --git a/tractor/_spawn.py b/tractor/_spawn.py index 4715bd1..4381491 100644 --- a/tractor/_spawn.py +++ b/tractor/_spawn.py @@ -513,7 +513,7 @@ async def trio_proc( # }) # track subactor in current nursery - curr_actor = current_actor() + curr_actor: Actor = current_actor() curr_actor._actoruid2nursery[subactor.uid] = actor_nursery # resume caller at next checkpoint now that child is up diff --git a/tractor/_supervise.py b/tractor/_supervise.py index df3d7de..be81e4e 100644 --- a/tractor/_supervise.py +++ b/tractor/_supervise.py @@ -119,11 +119,11 @@ class ActorNursery: name: str, *, bind_addrs: list[tuple[str, int]] = [_default_bind_addr], - rpc_module_paths: list[str] | None = None, - enable_modules: list[str] | None = None, - loglevel: str | None = None, # set log level per subactor - nursery: trio.Nursery | None = None, - debug_mode: bool | None = None, + rpc_module_paths: list[str]|None = None, + enable_modules: list[str]|None = None, + loglevel: str|None = None, # set log level per subactor + nursery: trio.Nursery|None = None, + debug_mode: bool|None = None, infect_asyncio: bool = False, ) -> Portal: '''