Fix Tor proxy when using httpx 0.21.x (#3165)

## What does this PR do?

This should fix #3164.
The problem is that `httpx` keeps making breaking changes to their library, so we just have to adjust the code a little bit to make it work with the new version of the library.


## Related issues
Closes  #3164
This commit is contained in:
Marc Abonce Seguin 2022-03-01 19:21:25 +00:00 committed by GitHub
parent 0669bfd7a5
commit c9e6d9f5f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -167,8 +167,7 @@ class Network:
for transport in client._mounts.values(): # pylint: disable=protected-access
if isinstance(transport, AsyncHTTPTransportNoHttp):
continue
if not getattr(transport, '_pool') and getattr(transport._pool, '_rdns', False):
result = False
if getattr(transport, '_pool') and getattr(transport._pool, '_rdns', False):
continue
return False
response = await client.get("https://check.torproject.org/api/ip", timeout=10)