Update socket exceptions (#3127)

* 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
This commit is contained in:
Sebastian Rittau
2019-07-19 01:50:28 +02:00
committed by Jelle Zijlstra
parent 40215d1fa3
commit dad16f2d43

View File

@@ -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,