From fae6bda3aeb63140920ff296b8de83a2cf9d0b6d Mon Sep 17 00:00:00 2001 From: Mariam Maarouf Date: Mon, 12 Oct 2020 20:45:48 +0200 Subject: [PATCH] Allow None in fp argument to HTTPError (#4660) --- stdlib/3/urllib/error.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/urllib/error.pyi b/stdlib/3/urllib/error.pyi index 83dcf8f8d..926f32d03 100644 --- a/stdlib/3/urllib/error.pyi +++ b/stdlib/3/urllib/error.pyi @@ -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): ...