Allow None in fp argument to HTTPError (#4660)

This commit is contained in:
Mariam Maarouf
2020-10-12 20:45:48 +02:00
committed by GitHub
parent 1dc3880400
commit fae6bda3ae

View File

@@ -1,4 +1,4 @@
from typing import IO, Mapping, Union
from typing import IO, Mapping, Optional, 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: str, code: int, msg: str, hdrs: Mapping[str, str], fp: IO[bytes]) -> None: ...
def __init__(self, url: str, code: int, msg: str, hdrs: Mapping[str, str], fp: Optional[IO[bytes]]) -> None: ...
class ContentTooShortError(URLError): ...