Added some missing type annotations in stdlib stubs. (#4418)

Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
Eric Traut
2020-08-08 11:49:37 -07:00
committed by GitHub
parent 030e5ad1dd
commit f46fb7ff59
16 changed files with 34 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
from typing import Union
from typing import IO, Mapping, Union
from urllib.response import addinfourl
# Stubs for urllib.error
@@ -8,6 +8,6 @@ class URLError(IOError):
class HTTPError(URLError, addinfourl):
code: int
def __init__(self, url, code, msg, hdrs, fp) -> None: ...
def __init__(self, url: str, code: int, msg: str, hdrs: Mapping[str, str], fp: IO[bytes]) -> None: ...
class ContentTooShortError(URLError): ...

View File

@@ -191,8 +191,8 @@ class UnknownHandler(BaseHandler):
def unknown_open(self, req: Request) -> NoReturn: ...
class HTTPErrorProcessor(BaseHandler):
def http_response(self, request, response) -> _UrlopenRet: ...
def https_response(self, request, response) -> _UrlopenRet: ...
def http_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ...
def https_response(self, request: Request, response: HTTPResponse) -> _UrlopenRet: ...
if sys.version_info >= (3, 6):
def urlretrieve(