Skip to content

Commit

Permalink
Accept either ARES_ETIMEOUT or ARES_EBADNAME for compatibility with c…
Browse files Browse the repository at this point in the history
…-ares 1.16 and 1.24
  • Loading branch information
Scott Kitterman committed Jan 2, 2024
1 parent c9b17d4 commit b3f06e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b3f06e1

Please sign in to comment.