From bb8452dbdb0e07f26369999f1912d2ca9a2d18f1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 6 Sep 2021 12:07:09 -0400 Subject: [PATCH] Ensure tuple for passed in arbiter addr --- tests/test_spawning.py | 7 ++++++- tractor/_root.py | 6 +++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/test_spawning.py b/tests/test_spawning.py index f9eeb16..b1110fe 100644 --- a/tests/test_spawning.py +++ b/tests/test_spawning.py @@ -1,6 +1,7 @@ """ Spawning basics """ +from typing import Dict, Tuple import pytest import trio @@ -11,7 +12,11 @@ from conftest import tractor_test data_to_pass_down = {'doggy': 10, 'kitty': 4} -async def spawn(is_arbiter, data, arb_addr): +async def spawn( + is_arbiter: bool, + data: Dict, + arb_addr: Tuple[str, int], +): namespaces = [__name__] await trio.sleep(0.1) diff --git a/tractor/_root.py b/tractor/_root.py index 9eba909..bbf337a 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -95,10 +95,10 @@ async def open_root_actor( "Debug mode is only supported for the `trio` backend!" ) - arbiter_addr = (host, port) = arbiter_addr or ( + arbiter_addr = (host, port) = tuple(arbiter_addr or ( _default_arbiter_host, - _default_arbiter_port - ) + _default_arbiter_port, + )) loglevel = loglevel or log.get_loglevel() if loglevel is not None: