From 94ea39fed766e17a3880eba12136d683ff2d341c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Thu, 18 Jul 2019 16:25:04 +0200 Subject: [PATCH] Update socket exceptions * error is an alias for OSError in Python 3 * herror and gaierror can be constructed without arguments (tested in Python 2.7 and 3.7) * timeout uses the same arguments as herror and gaierror --- stdlib/2and3/socket.pyi | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/stdlib/2and3/socket.pyi b/stdlib/2and3/socket.pyi index 4089b225c0e7..36da84951145 100644 --- a/stdlib/2and3/socket.pyi +++ b/stdlib/2and3/socket.pyi @@ -481,17 +481,19 @@ else: # ----- exceptions ----- -class error(IOError): - ... +if sys.version_info < (3,): + class error(IOError): ... +else: + error = OSError class herror(error): - def __init__(self, herror: int, string: str) -> None: ... + def __init__(self, herror: int = ..., string: str = ...) -> None: ... class gaierror(error): - def __init__(self, error: int, string: str) -> None: ... + def __init__(self, error: int = ..., string: str = ...) -> None: ... class timeout(error): - ... + def __init__(self, error: int = ..., string: str = ...) -> None: ... # Addresses can be either tuples of varying lengths (AF_INET, AF_INET6,