]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Keep clients in sync (#3120)
authorKar Petrosyan <92274156+karpetrosyan@users.noreply.github.com>
Thu, 29 Feb 2024 13:40:07 +0000 (08:40 -0500)
committerGitHub <noreply@github.com>
Thu, 29 Feb 2024 13:40:07 +0000 (13:40 +0000)
Co-authored-by: Tom Christie <tom@tomchristie.com>
httpx/_client.py

index 4645308f39bae4949979ba6e8e8725d7f34a3ac0..d95877e8bedee67d3d72855a636192e3f9bde3bf 100644 (file)
@@ -1054,7 +1054,7 @@ class Client(BaseClient):
         params: QueryParamTypes | None = None,
         headers: HeaderTypes | None = None,
         cookies: CookieTypes | None = None,
-        auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
+        auth: AuthTypes | UseClientDefault | None = USE_CLIENT_DEFAULT,
         follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
         timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
         extensions: RequestExtensions | None = None,
@@ -1391,8 +1391,7 @@ class AsyncClient(BaseClient):
         follow_redirects: bool = False,
         limits: Limits = DEFAULT_LIMITS,
         max_redirects: int = DEFAULT_MAX_REDIRECTS,
-        event_hooks: None
-        | (typing.Mapping[str, list[typing.Callable[..., typing.Any]]]) = None,
+        event_hooks: None | (typing.Mapping[str, list[EventHook]]) = None,
         base_url: URLTypes = "",
         transport: AsyncBaseTransport | None = None,
         app: typing.Callable[..., typing.Any] | None = None,
@@ -1438,7 +1437,7 @@ class AsyncClient(BaseClient):
             )
             warnings.warn(message, DeprecationWarning)
 
-        allow_env_proxies = trust_env and transport is None
+        allow_env_proxies = trust_env and app is None and transport is None
         proxy_map = self._get_proxy_map(proxies or proxy, allow_env_proxies)
 
         self._transport = self._init_transport(
@@ -1599,7 +1598,7 @@ class AsyncClient(BaseClient):
         params: QueryParamTypes | None = None,
         headers: HeaderTypes | None = None,
         cookies: CookieTypes | None = None,
-        auth: AuthTypes | UseClientDefault = USE_CLIENT_DEFAULT,
+        auth: AuthTypes | UseClientDefault | None = USE_CLIENT_DEFAULT,
         follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
         timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
         extensions: RequestExtensions | None = None,