diff options
author | Mark Sapiro <mark@msapiro.net> | 2014-04-19 17:54:06 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2014-04-19 17:54:06 -0700 |
commit | 6748722f16ff61f24c11f9cb8a90bcc0072c115f (patch) | |
tree | ff10b415aaa1443f22b2ba1ce247120854e1136f | |
parent | 129c7c266c2d60ee5165f4f31e6d336b997ad8fa (diff) | |
download | mailman2-6748722f16ff61f24c11f9cb8a90bcc0072c115f.tar.gz mailman2-6748722f16ff61f24c11f9cb8a90bcc0072c115f.tar.xz mailman2-6748722f16ff61f24c11f9cb8a90bcc0072c115f.zip |
The new Utils.IsDMARCProhibited() used collections.defaultdict which
requires Python 2.5. Changed to use a dict and setdefault.
Diffstat (limited to '')
-rw-r--r-- | Mailman/Utils.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 89b7975e..d62de364 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -35,7 +35,6 @@ import errno import base64 import random import urlparse -import collections import htmlentitydefs import email.Header import email.Iterators @@ -1096,7 +1095,7 @@ def IsDMARCProhibited(email): # where the answer section only contains what was asked for, nor to include # CNAMEs before the values they point to. full_record = "" - results_by_name = collections.defaultdict(list) + results_by_name = {} cnames = {} want_names = set([dmarc_domain + '.']) for txt_rec in txt_recs.response.answer: @@ -1105,7 +1104,7 @@ def IsDMARCProhibited(email): txt_rec.items[0].target.to_text()) if txt_rec.rdtype != dns.rdatatype.TXT: continue - results_by_name[txt_rec.name.to_text()].append( + results_by_name.setdefault(txt_rec.name.to_text(), []).append( "".join(txt_rec.items[0].strings)) expands = list(want_names) seen = set(expands) |