]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Drop deprecated proxies API (#1058)
authorTom Christie <tom@tomchristie.com>
Thu, 16 Jul 2020 08:44:41 +0000 (09:44 +0100)
committerGitHub <noreply@github.com>
Thu, 16 Jul 2020 08:44:41 +0000 (09:44 +0100)
httpx/_client.py

index 32b51950b2a481306c9be13ee9c87344f5c71ab6..35d0bd0fe53dbc3427943712b7a2cf1c70bc294e 100644 (file)
@@ -98,22 +98,11 @@ class BaseClient:
         elif isinstance(proxies, (str, URL, Proxy)):
             proxy = Proxy(url=proxies) if isinstance(proxies, (str, URL)) else proxies
             return {"all": proxy}
-        elif isinstance(proxies, httpcore.AsyncHTTPTransport):  # pragma: nocover
-            raise RuntimeError(
-                "Passing a transport instance to 'proxies=' is no longer "
-                "supported. Use `httpx.Proxy() instead.`"
-            )
         else:
             new_proxies = {}
             for key, value in proxies.items():
-                if isinstance(value, (str, URL, Proxy)):
-                    proxy = Proxy(url=value) if isinstance(value, (str, URL)) else value
-                    new_proxies[str(key)] = proxy
-                elif isinstance(value, httpcore.AsyncHTTPTransport):  # pragma: nocover
-                    raise RuntimeError(
-                        "Passing a transport instance to 'proxies=' is "
-                        "no longer supported. Use `httpx.Proxy() instead.`"
-                    )
+                proxy = Proxy(url=value) if isinstance(value, (str, URL)) else value
+                new_proxies[str(key)] = proxy
             return new_proxies
 
     @property