From 227c9ea1736fb363a92da99400e51207752cbaba Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 6 Nov 2023 15:43:43 -0500 Subject: [PATCH] Test with `any(portals)` since `gather_contexts()` will return `list[None | tuple]` --- tractor/_discovery.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tractor/_discovery.py b/tractor/_discovery.py index b5f4716..e5bc8db 100644 --- a/tractor/_discovery.py +++ b/tractor/_discovery.py @@ -211,10 +211,14 @@ async def find_actor( # 'Gathered portals:\n' # f'{portals}' # ) - if not portals: + # NOTE: `gather_contexts()` will return a + # `tuple[None, None, ..., None]` if no contact + # can be made with any regstrar at any of the + # N provided addrs! + if not any(portals): if raise_on_none: raise RuntimeError( - f'No {name} found registered @ {registry_addrs}' + f'No actor "{name}" found registered @ {registry_addrs}' ) yield None return