mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
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:
committed by
Jelle Zijlstra
parent
40215d1fa3
commit
dad16f2d43
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user