Skip to content

Commit 92075b3

Browse files
committed
Add deprecation warning
1 parent aa1461b commit 92075b3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/requests/adapters.py

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os.path
1010
import socket # noqa: F401
1111
import typing
12+
import warnings
1213

1314
from urllib3.exceptions import ClosedPoolError, ConnectTimeoutError
1415
from urllib3.exceptions import HTTPError as _HTTPError
@@ -425,6 +426,15 @@ def get_connection(self, url, proxies=None):
425426
:param proxies: (optional) A Requests-style dictionary of proxies used on this request.
426427
:rtype: urllib3.ConnectionPool
427428
"""
429+
warnings.warn(
430+
(
431+
"`get_connection` has been deprecated in favor of "
432+
"`get_connection_with_tls_context`. Custom HTTPAdapter subclasses "
433+
"will need to migrate for Requests>=2.32.2. Please see "
434+
"https://github.com/psf/requests/pull/6710 for more details."
435+
),
436+
DeprecationWarning,
437+
)
428438
proxy = select_proxy(url, proxies)
429439

430440
if proxy:

0 commit comments

Comments
 (0)