diff --git a/adafruit_requests.py b/adafruit_requests.py index c21f69c..75b5a70 100644 --- a/adafruit_requests.py +++ b/adafruit_requests.py @@ -620,8 +620,10 @@ def request( # noqa: PLR0912,PLR0913,PLR0915 Too many branches,Too many argumen raise ValueError("Unsupported protocol: " + proto) if ":" in host: - host, port = host.split(":", 1) + host_only, port = host.split(":", 1) port = int(port) + else: + host_only = host if self._last_response: self._last_response.close() @@ -638,7 +640,7 @@ def request( # noqa: PLR0912,PLR0913,PLR0915 Too many branches,Too many argumen while retry_count < 2: retry_count += 1 socket = self._connection_manager.get_socket( - host, + host_only, port, proto, session_id=self._session_id,