From 58a02c05558cce0e63704bf0e48acce40c5eb529 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 1 Jun 2025 16:56:09 +0000 Subject: [PATCH] :rotating_light: auto fix by pre-commit hooks --- zhenxun/utils/http_utils.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/zhenxun/utils/http_utils.py b/zhenxun/utils/http_utils.py index 9df95112..a1d0acb0 100644 --- a/zhenxun/utils/http_utils.py +++ b/zhenxun/utils/http_utils.py @@ -37,12 +37,21 @@ def get_async_client(proxies=None, **kwargs): try: return httpx.AsyncClient(proxies=proxies, **kwargs) except TypeError: - return httpx.AsyncClient(mounts={ - k: v for k, v in { - "http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http")) if proxies else None, - "https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https")) if proxies else None - }.items() if v is not None - }, **kwargs) + return httpx.AsyncClient( + mounts={ + k: v + for k, v in { + "http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http")) + if proxies + else None, + "https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https")) + if proxies + else None, + }.items() + if v is not None + }, + **kwargs, + ) class AsyncHttpx: