summaryrefslogtreecommitdiff
path: root/Mailman/Utils.py
diff options
context:
space:
mode:
authorcotton1998-11-19 14:37:00 +0000
committercotton1998-11-19 14:37:00 +0000
commitf585165cf15b5b62fc1c9dc37611f9e82a6badca (patch)
tree2b6cbfc310df86edad6291b1191971a32ef89af0 /Mailman/Utils.py
parent2160857b9fe3f92c30231e78e0a7dc2a05747e02 (diff)
downloadmailman-f585165cf15b5b62fc1c9dc37611f9e82a6badca.tar.gz
mailman-f585165cf15b5b62fc1c9dc37611f9e82a6badca.tar.zst
mailman-f585165cf15b5b62fc1c9dc37611f9e82a6badca.zip
whoops, just realized that there were a couple of places where i
didn't translate Utils.FindMatchingAddresses properly! in MailList.Post(), FindMatchingAddresses was applied to list.posters and list.forbidden_posters which are lists and not dicts, so I added a function in Utils called List2Dict that takes a list and retuns a dict keyed by the items in the list (it doesn't check for whether the items are hashable). All values are 1. This function is now used in MailList.Post(): where the FindMatchingAddresses was applied to an address list, it is now applied to Utils.List2Dict(address list). scott
Diffstat (limited to 'Mailman/Utils.py')
-rw-r--r--Mailman/Utils.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py
index 8dc110f2e..4e358d927 100644
--- a/Mailman/Utils.py
+++ b/Mailman/Utils.py
@@ -338,6 +338,14 @@ def GetPossibleMatchingAddrs(name):
return res
+def List2Dict(list):
+ """List2Dict returns a dict keyed by the entries in the list
+ passed to it."""
+ res = {}
+ for item in list:
+ res[item] = 1
+ return res
+
def FindMatchingAddresses(name, dict, *dicts):
"""Given an email address, and any number of dictionaries keyed by