From 9aa60992fbc87cb3c5cc21421ef7e59038d90540 Mon Sep 17 00:00:00 2001 From: vg Date: Sun, 21 Feb 2021 13:00:17 +0100 Subject: add compatibility for older dnspython releases --- acme_dns_tiny.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/acme_dns_tiny.py b/acme_dns_tiny.py index d89a46a..051e6ba 100644 --- a/acme_dns_tiny.py +++ b/acme_dns_tiny.py @@ -129,7 +129,11 @@ def self_challenge_check(*, domain=None, ttl=None, challenge=None): time.sleep(ttl) log.debug('Self check number %s', checknum) try: - responses = resolver.resolve(domain, rdtype='TXT').rrset + try: + responses = resolver.resolve(domain, rdtype='TXT').rrset + except AttributeError: + # backward compatibility for older dns dnspython releases + responses = resolver.query(domain, rdtype='TXT').rrset except dns.exception.DNSException as e: log.debug(' - DNS error: %s: %s', type(e).__name__, e) continue -- cgit v1.2.3