Skip to content

Commit 85a6f0f

Browse files
socket: add all_errors param to create_connection (#7691)
python/cpython#91704
1 parent c8a978f commit 85a6f0f

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

‎stdlib/socket.pyi‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,11 +605,22 @@ class SocketIO(RawIOBase):
605605
def mode(self) -> Literal["rb", "wb", "rwb"]: ...
606606

607607
def getfqdn(name: str = ...) -> str: ...
608-
def create_connection(
609-
address: tuple[str | None, int],
610-
timeout: float | None = ..., # noqa: F811
611-
source_address: tuple[bytearray | bytes | str, int] | None = ...,
612-
) -> socket: ...
608+
609+
if sys.version_info >= (3, 11):
610+
def create_connection(
611+
address: tuple[str | None, int],
612+
timeout: float | None = ..., # noqa: F811
613+
source_address: tuple[bytearray | bytes | str, int] | None = ...,
614+
*,
615+
all_errors: bool = ...,
616+
) -> socket: ...
617+
618+
else:
619+
def create_connection(
620+
address: tuple[str | None, int],
621+
timeout: float | None = ..., # noqa: F811
622+
source_address: tuple[bytearray | bytes | str, int] | None = ...,
623+
) -> socket: ...
613624

614625
if sys.version_info >= (3, 8):
615626
def has_dualstack_ipv6() -> bool: ...

0 commit comments

Comments
 (0)