mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🚨 auto fix by pre-commit hooks
This commit is contained in:
parent
1ae0de87ce
commit
58a02c0555
@ -37,12 +37,21 @@ def get_async_client(proxies=None, **kwargs):
|
|||||||
try:
|
try:
|
||||||
return httpx.AsyncClient(proxies=proxies, **kwargs)
|
return httpx.AsyncClient(proxies=proxies, **kwargs)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
return httpx.AsyncClient(mounts={
|
return httpx.AsyncClient(
|
||||||
k: v for k, v in {
|
mounts={
|
||||||
"http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http")) if proxies else None,
|
k: v
|
||||||
"https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https")) if proxies else None
|
for k, v in {
|
||||||
}.items() if v is not None
|
"http://": httpx.AsyncHTTPTransport(proxy=proxies.get("http"))
|
||||||
}, **kwargs)
|
if proxies
|
||||||
|
else None,
|
||||||
|
"https://": httpx.AsyncHTTPTransport(proxy=proxies.get("https"))
|
||||||
|
if proxies
|
||||||
|
else None,
|
||||||
|
}.items()
|
||||||
|
if v is not None
|
||||||
|
},
|
||||||
|
**kwargs,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class AsyncHttpx:
|
class AsyncHttpx:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user