mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Added attributes for URLError and HTTPError (#494)
This commit is contained in:
committed by
David Fisher
parent
5b5135878b
commit
aef68f323f
@@ -1,10 +1,13 @@
|
||||
|
||||
from typing import AnyStr
|
||||
from typing import AnyStr, Dict, Union
|
||||
from urllib import addinfourl
|
||||
|
||||
class URLError(IOError): ...
|
||||
class URLError(IOError):
|
||||
reason = ... # type: Union[str, BaseException]
|
||||
|
||||
class HTTPError(URLError, addinfourl): ...
|
||||
class HTTPError(URLError, addinfourl):
|
||||
code = ... # type: int
|
||||
headers = ... # type: Dict[str, str]
|
||||
|
||||
class Request(object):
|
||||
host = ... # type: str
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
from typing import Any, Dict, Union
|
||||
from urllib.response import addinfourl
|
||||
|
||||
# Stubs for urllib.error
|
||||
|
||||
class URLError(IOError): ...
|
||||
class HTTPError(URLError): ...
|
||||
class URLError(IOError):
|
||||
reason = ... # type: Union[str, BaseException]
|
||||
class HTTPError(URLError, addinfourl):
|
||||
code = ... # type: int
|
||||
headers = ... # type: Dict[str, str]
|
||||
class ContentTooShortError(URLError): ...
|
||||
|
||||
Reference in New Issue
Block a user