From d27c081a15ef0a36d11526ed980298e072a9518b Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 13 Dec 2022 00:23:27 -0500 Subject: [PATCH] Ensure arbiter sockaddr type before usage --- tractor/_runtime.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tractor/_runtime.py b/tractor/_runtime.py index cbbb9ae..cc780a7 100644 --- a/tractor/_runtime.py +++ b/tractor/_runtime.py @@ -455,7 +455,7 @@ class Actor: self._mods: dict[str, ModuleType] = {} self.loglevel = loglevel - self._arb_addr = ( + self._arb_addr: tuple[str, int] | None = ( str(arbiter_addr[0]), int(arbiter_addr[1]) ) if arbiter_addr else None @@ -1381,6 +1381,7 @@ async def async_main( and not actor.is_arbiter ): failed = False + assert isinstance(actor._arb_addr, tuple) with trio.move_on_after(0.5) as cs: cs.shield = True try: