Skip to content

Commit 2fb044c

Browse files
committed
Proper warning level of deprecation notice
This enables us to control emitted messages via the PYTHONWARNINGS environment variable or by -W option.
1 parent c6872e1 commit 2fb044c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

httpx/_models.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -876,15 +876,17 @@ def __repr__(self) -> str:
876876
def stream(self): # type: ignore
877877
warnings.warn( # pragma: nocover
878878
"Response.stream() is due to be deprecated. "
879-
"Use Response.aiter_bytes() instead."
879+
"Use Response.aiter_bytes() instead.",
880+
DeprecationWarning,
880881
)
881882
return self.aiter_bytes # pragma: nocover
882883

883884
@property
884885
def raw(self): # type: ignore
885886
warnings.warn( # pragma: nocover
886887
"Response.raw() is due to be deprecated. "
887-
"Use Response.aiter_raw() instead."
888+
"Use Response.aiter_raw() instead.",
889+
DeprecationWarning,
888890
)
889891
return self.aiter_raw # pragma: nocover
890892

0 commit comments

Comments
 (0)