From b3f06e1e5e30e1a6acbf3d2111bbe12ac9dfbf9c Mon Sep 17 00:00:00 2001 From: Scott Kitterman Date: Tue, 2 Jan 2024 13:58:23 -0500 Subject: [PATCH] Accept either ARES_ETIMEOUT or ARES_EBADNAME for compatibility with c-ares 1.16 and 1.24 --- tests/test_all.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_all.py b/tests/test_all.py index 4f569cd..961aa4d 100755 --- a/tests/test_all.py +++ b/tests/test_all.py @@ -569,6 +569,9 @@ def cb(result, errorno): # try encoding it as utf-8 self.channel.query(host.encode(), pycares.QUERY_TYPE_A, cb) self.wait() + # ARES_EBADNAME correct for c-ares 1.24 and ARES_ETIMEOUT for 1.18 + if self.errorno == pycares.errno.ARES_ETIMEOUT: + self.errorno = pycares.errno.ARES_EBADNAME self.assertEqual(self.errorno, pycares.errno.ARES_EBADNAME) self.assertEqual(self.result, None) # use it as is (it's IDNA encoded internally)