Skip to content
Myr

Drop deprecated proxies API (#1058)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tom Christie · committed by GitHub · parent 3f96e74 · Browse files · 1 file+2 added−13 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−13 removed

  • other:+2 added−13 removed

1 file+2 added−13 removed

modified:httpx/_client.py+2 added-13 removed
96 unmodified lines
97 return {}98 elif isinstance(proxies, (str, URL, Proxy)):99 proxy = Proxy(url=proxies) if isinstance(proxies, (str, URL)) else proxies100 return {"all": proxy}101 elif isinstance(proxies, httpcore.AsyncHTTPTransport): # pragma: nocover102 raise RuntimeError(103 "Passing a transport instance to 'proxies=' is no longer "104 "supported. Use `httpx.Proxy() instead.`"105 )101 else:102 new_proxies = {}103 for key, value in proxies.items():109 if isinstance(value, (str, URL, Proxy)):110 proxy = Proxy(url=value) if isinstance(value, (str, URL)) else value111 new_proxies[str(key)] = proxy104 proxy = Proxy(url=value) if isinstance(value, (str, URL)) else value105 new_proxies[str(key)] = proxy112 elif isinstance(value, httpcore.AsyncHTTPTransport): # pragma: nocover113 raise RuntimeError(114 "Passing a transport instance to 'proxies=' is "115 "no longer supported. Use `httpx.Proxy() instead.`"116 )106 return new_proxies107108 @property109 def headers(self) -> Headers:
1409 unmodified lines