From: Tom Christie Date: Thu, 16 Jul 2020 08:44:41 +0000 (+0100) Subject: Drop deprecated proxies API (#1058) X-Git-Tag: 0.14.0~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccd4711a0a163ecc326cabe827115c136ae52552;p=thirdparty%2Fhttpx.git Drop deprecated proxies API (#1058) --- diff --git a/httpx/_client.py b/httpx/_client.py index 32b51950..35d0bd0f 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -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