Added attributes for URLError and HTTPError (#494)

This commit is contained in:
peterdotran
2016-08-23 17:55:51 -07:00
committed by David Fisher
parent 5b5135878b
commit aef68f323f
2 changed files with 14 additions and 5 deletions

View File

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

View File

@@ -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): ...