diff options
Diffstat (limited to 'src/mailman/utilities/string.py')
| -rw-r--r-- | src/mailman/utilities/string.py | 14 |
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) |
