From e92bfcbab2d15c407acc6ebaeceda5688e65e280 Mon Sep 17 00:00:00 2001 From: Sandro Huber Date: Fri, 13 Oct 2023 18:10:56 +0200 Subject: [PATCH] [requests] Allow HTTPError.response to be None (#10875) This aligns with the definition in requests, but means that user code might need additional assertions to ensure that `HTTPError.response` is not `None`. --- stubs/requests/requests/exceptions.pyi | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stubs/requests/requests/exceptions.pyi b/stubs/requests/requests/exceptions.pyi index 62fa11dc5..99f4448d9 100644 --- a/stubs/requests/requests/exceptions.pyi +++ b/stubs/requests/requests/exceptions.pyi @@ -12,12 +12,7 @@ class RequestException(OSError): class InvalidJSONError(RequestException): ... class JSONDecodeError(InvalidJSONError): ... - -class HTTPError(RequestException): - request: Request | PreparedRequest | None - response: Response - def __init__(self, *args: object, request: Request | PreparedRequest | None = ..., response: Response) -> None: ... - +class HTTPError(RequestException): ... class ConnectionError(RequestException): ... class ProxyError(ConnectionError): ... class SSLError(ConnectionError): ...