From 93d50eb6a2bb852761ff1c6b7d49a9c032767daa Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 13 Nov 2026 20:08:29 -0600 Subject: [PATCH 1/2] Correct PySocks timeout and optional socket error types --- stubs/PySocks/socks.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/PySocks/socks.pyi b/stubs/PySocks/socks.pyi index 18ecec651ef6..b19538cb60d5 100644 --- a/stubs/PySocks/socks.pyi +++ b/stubs/PySocks/socks.pyi @@ -28,7 +28,7 @@ def set_self_blocking(function: Callable[_P, _T]) -> Callable[_P, _T]: ... # un class ProxyError(IOError): msg: str - socket_err: socket.error + socket_err: socket.error | None def __init__(self, msg: str, socket_err: socket.error | None = None) -> None: ... class GeneralProxyError(ProxyError): ... @@ -74,7 +74,7 @@ _Endpoint: TypeAlias = tuple[str, int] def create_connection( dest_pair: _Endpoint, - timeout: int | None = None, + timeout: float | None = None, source_address: _Endpoint | None = None, proxy_type: _ProxyType | None = None, proxy_addr: str | None = None, From 495dad400bdb4571e0eb4533e2429bc82bbb4687 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 14 Nov 2026 11:04:58 -0600 Subject: [PATCH 2/2] Spell out integer timeout support per review --- stubs/PySocks/socks.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/PySocks/socks.pyi b/stubs/PySocks/socks.pyi index b19538cb60d5..d87953b0f763 100644 --- a/stubs/PySocks/socks.pyi +++ b/stubs/PySocks/socks.pyi @@ -74,7 +74,7 @@ _Endpoint: TypeAlias = tuple[str, int] def create_connection( dest_pair: _Endpoint, - timeout: float | None = None, + timeout: float | int | None = None, source_address: _Endpoint | None = None, proxy_type: _ProxyType | None = None, proxy_addr: str | None = None,