From f563dcd3658a2b64b37793c8810c4560cc532454 Mon Sep 17 00:00:00 2001 From: Eugene K Date: Fri, 22 Sep 2023 15:21:10 -0400 Subject: [PATCH] make sure `create_ziti_connection()` matches `socket.create_connection()` --- src/openziti/zitisock.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openziti/zitisock.py b/src/openziti/zitisock.py index 56335de..8a0bb0d 100644 --- a/src/openziti/zitisock.py +++ b/src/openziti/zitisock.py @@ -30,7 +30,7 @@ def process_bindings(orig): port = 0 val = orig[k] if isinstance(k, tuple): - host,port = k + host, port = k elif isinstance(k, str): l = k.split(':') if len(l) == 1: @@ -46,7 +46,6 @@ def process_bindings(orig): return bindings - class ZitiSocket(PySocket): # pylint: disable=redefined-builtin def __init__(self, af=-1, type=-1, proto=-1, fileno=None, opts=None): @@ -127,7 +126,8 @@ def setsockopt(self, __level: int, __optname: int, __value: Union[int, bytes]) - pass -def create_ziti_connection(address, **_): +def create_ziti_connection(address, timeout=None, + source_address=None, *, all_errors=False): sock = ZitiSocket(socket.SOCK_STREAM) sock.connect(address) return sock