@@ -793,6 +793,7 @@ def __init__(
793793 custom_query : Mapping [str , object ] | None = None ,
794794 _strict_response_validation : bool ,
795795 ) -> None :
796+ kwargs : dict [str , Any ] = {}
796797 if limits is not None :
797798 warnings .warn (
798799 "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead" ,
@@ -805,6 +806,7 @@ def __init__(
805806 limits = DEFAULT_CONNECTION_LIMITS
806807
807808 if transport is not None :
809+ kwargs ["transport" ] = transport
808810 warnings .warn (
809811 "The `transport` argument is deprecated. The `http_client` argument should be passed instead" ,
810812 category = DeprecationWarning ,
@@ -814,6 +816,7 @@ def __init__(
814816 raise ValueError ("The `http_client` argument is mutually exclusive with `transport`" )
815817
816818 if proxies is not None :
819+ kwargs ["proxies" ] = proxies
817820 warnings .warn (
818821 "The `proxies` argument is deprecated. The `http_client` argument should be passed instead" ,
819822 category = DeprecationWarning ,
@@ -857,10 +860,9 @@ def __init__(
857860 base_url = base_url ,
858861 # cast to a valid type because mypy doesn't understand our type narrowing
859862 timeout = cast (Timeout , timeout ),
860- proxies = proxies ,
861- transport = transport ,
862863 limits = limits ,
863864 follow_redirects = True ,
865+ ** kwargs , # type: ignore
864866 )
865867
866868 def is_closed (self ) -> bool :
@@ -1374,6 +1376,7 @@ def __init__(
13741376 custom_headers : Mapping [str , str ] | None = None ,
13751377 custom_query : Mapping [str , object ] | None = None ,
13761378 ) -> None :
1379+ kwargs : dict [str , Any ] = {}
13771380 if limits is not None :
13781381 warnings .warn (
13791382 "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead" ,
@@ -1386,6 +1389,7 @@ def __init__(
13861389 limits = DEFAULT_CONNECTION_LIMITS
13871390
13881391 if transport is not None :
1392+ kwargs ["transport" ] = transport
13891393 warnings .warn (
13901394 "The `transport` argument is deprecated. The `http_client` argument should be passed instead" ,
13911395 category = DeprecationWarning ,
@@ -1395,6 +1399,7 @@ def __init__(
13951399 raise ValueError ("The `http_client` argument is mutually exclusive with `transport`" )
13961400
13971401 if proxies is not None :
1402+ kwargs ["proxies" ] = proxies
13981403 warnings .warn (
13991404 "The `proxies` argument is deprecated. The `http_client` argument should be passed instead" ,
14001405 category = DeprecationWarning ,
@@ -1438,10 +1443,9 @@ def __init__(
14381443 base_url = base_url ,
14391444 # cast to a valid type because mypy doesn't understand our type narrowing
14401445 timeout = cast (Timeout , timeout ),
1441- proxies = proxies ,
1442- transport = transport ,
14431446 limits = limits ,
14441447 follow_redirects = True ,
1448+ ** kwargs , # type: ignore
14451449 )
14461450
14471451 def is_closed (self ) -> bool :
0 commit comments