Skip to content

Commit 8f763f9

Browse files
committed
typing self workaround
1 parent 73b2937 commit 8f763f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

httpx/_models.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ def __setstate__(self, state: dict[str, typing.Any]) -> None:
446446
self.stream = UnattachedStream()
447447

448448

449+
_ResponseT = typing.TypeVar("_ResponseT", bound="Response")
450+
451+
449452
class Response:
450453
def __init__(
451454
self,
@@ -725,7 +728,7 @@ def has_redirect_location(self) -> bool:
725728
and "Location" in self.headers
726729
)
727730

728-
def raise_for_status(self) -> Response:
731+
def raise_for_status(self: _ResponseT) -> _ResponseT:
729732
"""
730733
Raise the `HTTPStatusError` if one occurred.
731734
"""

0 commit comments

Comments
 (0)