Skip to content

Commit e92bfcb

Browse files
authored
[requests] Allow HTTPError.response to be None (python#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`.
1 parent f3506eb commit e92bfcb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

stubs/requests/requests/exceptions.pyi

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@ class RequestException(OSError):
1212

1313
class InvalidJSONError(RequestException): ...
1414
class JSONDecodeError(InvalidJSONError): ...
15-
16-
class HTTPError(RequestException):
17-
request: Request | PreparedRequest | None
18-
response: Response
19-
def __init__(self, *args: object, request: Request | PreparedRequest | None = ..., response: Response) -> None: ...
20-
15+
class HTTPError(RequestException): ...
2116
class ConnectionError(RequestException): ...
2217
class ProxyError(ConnectionError): ...
2318
class SSLError(ConnectionError): ...

0 commit comments

Comments
 (0)