Skip to content

Commit a369813

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
fix(client): compat with new httpx 0.28.0 release (#2228)
1 parent ace3716 commit a369813

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/cloudflare/_base_client.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,7 @@ def __init__(
792792
custom_query: Mapping[str, object] | None = None,
793793
_strict_response_validation: bool,
794794
) -> None:
795+
kwargs: dict[str, Any] = {}
795796
if limits is not None:
796797
warnings.warn(
797798
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -804,6 +805,7 @@ def __init__(
804805
limits = DEFAULT_CONNECTION_LIMITS
805806

806807
if transport is not None:
808+
kwargs["transport"] = transport
807809
warnings.warn(
808810
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
809811
category=DeprecationWarning,
@@ -813,6 +815,7 @@ def __init__(
813815
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
814816

815817
if proxies is not None:
818+
kwargs["proxies"] = proxies
816819
warnings.warn(
817820
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
818821
category=DeprecationWarning,
@@ -856,10 +859,9 @@ def __init__(
856859
base_url=base_url,
857860
# cast to a valid type because mypy doesn't understand our type narrowing
858861
timeout=cast(Timeout, timeout),
859-
proxies=proxies,
860-
transport=transport,
861862
limits=limits,
862863
follow_redirects=True,
864+
**kwargs, # type: ignore
863865
)
864866

865867
def is_closed(self) -> bool:
@@ -1358,6 +1360,7 @@ def __init__(
13581360
custom_headers: Mapping[str, str] | None = None,
13591361
custom_query: Mapping[str, object] | None = None,
13601362
) -> None:
1363+
kwargs: dict[str, Any] = {}
13611364
if limits is not None:
13621365
warnings.warn(
13631366
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1370,6 +1373,7 @@ def __init__(
13701373
limits = DEFAULT_CONNECTION_LIMITS
13711374

13721375
if transport is not None:
1376+
kwargs["transport"] = transport
13731377
warnings.warn(
13741378
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
13751379
category=DeprecationWarning,
@@ -1379,6 +1383,7 @@ def __init__(
13791383
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
13801384

13811385
if proxies is not None:
1386+
kwargs["proxies"] = proxies
13821387
warnings.warn(
13831388
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
13841389
category=DeprecationWarning,
@@ -1422,10 +1427,9 @@ def __init__(
14221427
base_url=base_url,
14231428
# cast to a valid type because mypy doesn't understand our type narrowing
14241429
timeout=cast(Timeout, timeout),
1425-
proxies=proxies,
1426-
transport=transport,
14271430
limits=limits,
14281431
follow_redirects=True,
1432+
**kwargs, # type: ignore
14291433
)
14301434

14311435
def is_closed(self) -> bool:

0 commit comments

Comments
 (0)