From ddebb83ea7680fddf3dc71c9f17dd12b1b3c4028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Bj=C3=A4reholt?= Date: Wed, 20 Sep 2023 14:20:33 +0200 Subject: [PATCH] requests: type RequestException members (not Any) (#8989) Co-authored-by: Alex Waygood --- stubs/requests/requests/exceptions.pyi | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/stubs/requests/requests/exceptions.pyi b/stubs/requests/requests/exceptions.pyi index b642d5ad3..99c8a9edc 100644 --- a/stubs/requests/requests/exceptions.pyi +++ b/stubs/requests/requests/exceptions.pyi @@ -1,15 +1,19 @@ -from typing import Any - from urllib3.exceptions import HTTPError as BaseHTTPError +from .models import Request, Response + class RequestException(OSError): - response: Any - request: Any + response: Response | None + request: Request | None def __init__(self, *args, **kwargs) -> None: ... class InvalidJSONError(RequestException): ... class JSONDecodeError(InvalidJSONError): ... -class HTTPError(RequestException): ... + +class HTTPError(RequestException): + request: Request + response: Response + class ConnectionError(RequestException): ... class ProxyError(ConnectionError): ... class SSLError(ConnectionError): ...