Skip to content

Commit e69545c

Browse files
committed
typing self workaround
1 parent 73b2937 commit e69545c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

httpx/_models.py

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

448448

449+
_ResponseT = typing.TypeVar('_ResponseT', bound='Response')
450+
449451
class Response:
450452
def __init__(
451453
self,
@@ -725,7 +727,7 @@ def has_redirect_location(self) -> bool:
725727
and "Location" in self.headers
726728
)
727729

728-
def raise_for_status(self) -> Response:
730+
def raise_for_status(self: _ResponseT) -> _ResponseT:
729731
"""
730732
Raise the `HTTPStatusError` if one occurred.
731733
"""

0 commit comments

Comments
 (0)