Test with `any(portals)` since `gather_contexts()` will return `list[None | tuple]`

modden_spawn_from_client_req
Tyler Goodlet 2023-11-06 15:43:43 -05:00
parent 1a1f136c85
commit 382fd91bf3
1 changed files with 6 additions and 2 deletions

View File

@ -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