mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-05 17:37:41 +08:00
Added some missing type annotations in stdlib stubs. (#4418)
Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
@@ -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): ...
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user