mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-19 02:15:58 +08:00
Change type for urllib headers from Mapping to email.message.Message (#3345)
Also remove override of 'headers' in HTTPError Closes #3344
This commit is contained in:
committed by
Sebastian Rittau
parent
bb12f3bdea
commit
6a92ae6295
@@ -7,6 +7,5 @@ class URLError(IOError):
|
||||
reason: Union[str, BaseException]
|
||||
class HTTPError(URLError, addinfourl):
|
||||
code: int
|
||||
headers: Dict[str, str]
|
||||
def __init__(self, url, code, msg, hdrs, fp) -> None: ...
|
||||
class ContentTooShortError(URLError): ...
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# private module, we only expose what's needed
|
||||
|
||||
from typing import BinaryIO, Iterable, List, Mapping, Optional, Type, TypeVar
|
||||
from email.message import Message
|
||||
from types import TracebackType
|
||||
|
||||
_AIUT = TypeVar("_AIUT", bound=addbase)
|
||||
@@ -31,8 +32,8 @@ class addbase(BinaryIO):
|
||||
def writelines(self, lines: Iterable[bytes]) -> None: ...
|
||||
|
||||
class addinfo(addbase):
|
||||
headers: Mapping[str, str]
|
||||
def info(self) -> Mapping[str, str]: ...
|
||||
headers: Message
|
||||
def info(self) -> Message: ...
|
||||
|
||||
class addinfourl(addinfo):
|
||||
url: str
|
||||
|
||||
Reference in New Issue
Block a user