From c1d3cded33cf960bf3ed529bde8a8a3658384d3a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 6 Feb 2024 08:37:58 +0100 Subject: [PATCH] [FIX] Adapt code to Python 3.11 As the build is not fixed to a Python version, last build has put Python 3.11 as the target interpreter, and there are an incompatibility in the code and one deprecation that is fixed in this commit. --- proxy.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/proxy.py b/proxy.py index 0b1665f..ae0f853 100755 --- a/proxy.py +++ b/proxy.py @@ -18,11 +18,10 @@ if os.environ["PRE_RESOLVE"] == "1": resolver = Resolver() resolver.nameservers = os.environ["NAMESERVERS"].split() - ip = random.choice([answer.address for answer in resolver.query(target)]) + ip = random.choice([answer.address for answer in resolver.resolve(target)]) logging.info("Resolved %s to %s", target, ip) -@asyncio.coroutine async def netcat(port): # Use a persistent BusyBox netcat server in listening mode command = ["socat"]