Appease 3.8 mypy

pdb_madness
Tyler Goodlet 2020-12-10 14:07:36 -05:00
parent e51c2620e5
commit d497078eb7
2 changed files with 9 additions and 7 deletions

View File

@ -821,7 +821,7 @@ class Actor:
self._server_down = trio.Event()
try:
async with trio.open_nursery() as server_n:
listeners: List[trio.abc.Listener] = await server_n.start(
l: List[trio.abc.Listener] = await server_n.start(
partial(
trio.serve_tcp,
self._stream_handler,
@ -832,9 +832,10 @@ class Actor:
host=accept_host,
)
)
log.debug("Started tcp server(s) on" # type: ignore
f" {[l.socket for l in listeners]}")
self._listeners.extend(listeners)
log.debug(
"Started tcp server(s) on"
f" {[getattr(l, 'socket', 'unknown socket') for l in l]}")
self._listeners.extend(l)
task_status.started(server_n)
finally:
# signal the server is down since nursery above terminated

View File

@ -15,7 +15,7 @@ log = get_logger(__name__)
def _mp_main(
actor: 'Actor', # noqa
actor: 'Actor', # type: ignore
accept_addr: Tuple[str, int],
forkserver_info: Tuple[Any, Any, Any, Any, Any],
start_method: str,
@ -54,8 +54,9 @@ def _mp_main(
def _trio_main(
actor: 'Actor', # noqa
parent_addr: Tuple[str, int] = None
actor: 'Actor', # type: ignore
*,
parent_addr: Tuple[str, int] = None,
) -> None:
"""Entry point for a `trio_run_in_process` subactor.
"""