summaryrefslogtreecommitdiff
path: root/src/mailman/utilities/string.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-10-31 17:31:12 +0100
committerBarry Warsaw2012-10-31 17:31:12 +0100
commita9464c14fc6dfc23613a1ec89446393fe6476f88 (patch)
tree74a926cfe64066ebffcf9adb89e7672289173d84 /src/mailman/utilities/string.py
parenta1666479d87e26e5c79dd1cf507b8ef0472c59aa (diff)
downloadmailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.gz
mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.tar.zst
mailman-a9464c14fc6dfc23613a1ec89446393fe6476f88.zip
Diffstat (limited to 'src/mailman/utilities/string.py')
-rw-r--r--src/mailman/utilities/string.py14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/mailman/utilities/string.py b/src/mailman/utilities/string.py
index 7470bd476..cd3adc536 100644
--- a/src/mailman/utilities/string.py
+++ b/src/mailman/utilities/string.py
@@ -60,19 +60,7 @@ def expand(template, substitutions, template_class=Template):
:return: The substituted string.
:rtype: string
"""
- # Python 2.6 requires ** dictionaries to have str, not unicode keys, so
- # convert as necessary. Note that string.Template uses **. For our
- # purposes, keys should always be ascii. Values though can be anything.
- cooked = substitutions.__class__()
- for key in substitutions:
- if isinstance(key, unicode):
- key = key.encode('ascii')
- cooked[key] = substitutions[key]
- try:
- return template_class(template).safe_substitute(cooked)
- except (TypeError, ValueError):
- # The template is really screwed up.
- log.exception('broken template: %s', template)
+ return template_class(template).safe_substitute(substitutions)