Skip to content

Commit 41c18af

Browse files
authored
[http.client] Deprecate HTTPResponse methods (#15241)
1 parent f30821c commit 41c18af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stdlib/http/client.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from collections.abc import Callable, Iterable, Iterator, Mapping
88
from email._policybase import _MessageT
99
from socket import socket
1010
from typing import BinaryIO, Final, TypeVar, overload
11-
from typing_extensions import Self, TypeAlias
11+
from typing_extensions import Self, TypeAlias, deprecated
1212

1313
__all__ = [
1414
"HTTPResponse",
@@ -160,8 +160,11 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore[misc] # incomp
160160
def __exit__(
161161
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None
162162
) -> None: ...
163+
@deprecated("Deprecated since Python 3.9. Use `HTTPResponse.headers` attribute instead.")
163164
def info(self) -> email.message.Message: ...
165+
@deprecated("Deprecated since Python 3.9. Use `HTTPResponse.url` attribute instead.")
164166
def geturl(self) -> str: ...
167+
@deprecated("Deprecated since Python 3.9. Use `HTTPResponse.status` attribute instead.")
165168
def getcode(self) -> int: ...
166169
def begin(self) -> None: ...
167170

0 commit comments

Comments
 (0)