@@ -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 :
@@ -1373,6 +1375,7 @@ def __init__(
13731375 custom_headers : Mapping [str , str ] | None = None ,
13741376 custom_query : Mapping [str , object ] | None = None ,
13751377 ) -> None :
1378+ kwargs : dict [str , Any ] = {}
13761379 if limits is not None :
13771380 warnings .warn (
13781381 "The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead" ,
@@ -1385,6 +1388,7 @@ def __init__(
13851388 limits = DEFAULT_CONNECTION_LIMITS
13861389
13871390 if transport is not None :
1391+ kwargs ["transport" ] = transport
13881392 warnings .warn (
13891393 "The `transport` argument is deprecated. The `http_client` argument should be passed instead" ,
13901394 category = DeprecationWarning ,
@@ -1394,6 +1398,7 @@ def __init__(
13941398 raise ValueError ("The `http_client` argument is mutually exclusive with `transport`" )
13951399
13961400 if proxies is not None :
1401+ kwargs ["proxies" ] = proxies
13971402 warnings .warn (
13981403 "The `proxies` argument is deprecated. The `http_client` argument should be passed instead" ,
13991404 category = DeprecationWarning ,
@@ -1437,10 +1442,9 @@ def __init__(
14371442 base_url = base_url ,
14381443 # cast to a valid type because mypy doesn't understand our type narrowing
14391444 timeout = cast (Timeout , timeout ),
1440- proxies = proxies ,
1441- transport = transport ,
14421445 limits = limits ,
14431446 follow_redirects = True ,
1447+ ** kwargs , # type: ignore
14441448 )
14451449
14461450 def is_closed (self ) -> bool :
0 commit comments