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

View File

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