From b022f76516fb64328b4e990be1256a2d82a2ebf9 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Mon, 18 Feb 2019 11:32:25 +0100 Subject: [PATCH] socket: timeout may be None (#2801) timeout=None puts the socket into blocking mode. Read and the referenced other issues for more gory details. --- stdlib/2and3/socket.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/socket.pyi b/stdlib/2and3/socket.pyi index b2e8fe272..63439fb25 100644 --- a/stdlib/2and3/socket.pyi +++ b/stdlib/2and3/socket.pyi @@ -537,7 +537,7 @@ class socket: @overload def getsockopt(self, level: int, optname: int, buflen: int) -> bytes: ... - def gettimeout(self) -> float: ... + def gettimeout(self) -> Optional[float]: ... def ioctl(self, control: object, option: Tuple[int, int, int]) -> None: ... if sys.version_info < (3, 5): @@ -579,7 +579,7 @@ class socket: # ----- functions ----- def create_connection(address: Tuple[Optional[str], int], - timeout: float = ..., + timeout: Optional[float] = ..., source_address: Tuple[Union[bytearray, bytes, Text], int] = ...) -> socket: ... # the 5th tuple item is an address