From c9e6d9f5f6d6963ec9285e119ff645ba8f0a0fc7 Mon Sep 17 00:00:00 2001 From: Marc Abonce Seguin Date: Tue, 1 Mar 2022 19:21:25 +0000 Subject: [PATCH] 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 --- searx/network/network.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/searx/network/network.py b/searx/network/network.py index 30f82279..17c98a8d 100644 --- a/searx/network/network.py +++ b/searx/network/network.py @@ -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)