aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-23 09:47:38 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-11-23 09:47:38 -0500
commit8f18e98fc2fbe451195c2b84cdb0c87414399baf (patch)
tree04a64801731e18c7ec4763f3f4c7524d72c35f1d
parent403142cb0cbb24ba380a44de1c8d32fa263084c7 (diff)
downloadb4-8f18e98fc2fbe451195c2b84cdb0c87414399baf.tar.gz
Work with older dnspython for dkim calls
If we find an older dnspython < 2.0, don't crash but let dkim figure out how it wants to look up TXT records on its own. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/b4/__init__.py b/b4/__init__.py
index d21aab2..c1e0826 100644
--- a/b4/__init__.py
+++ b/b4/__init__.py
@@ -2353,6 +2353,10 @@ def dkim_get_txt(name: bytes, timeout: int = 5):
if txtdata.find(b'p=') >= 0:
_DKIM_DNS_CACHE[name] = txtdata
return txtdata
+ except AttributeError:
+ # Try the native call
+ _DKIM_DNS_CACHE[name] = dkim.dnsplug.get_txt(name, timeout)
+ return _DKIM_DNS_CACHE[name]
except dns.resolver.NXDOMAIN:
pass
_DKIM_DNS_CACHE[name] = None