diff options
Diffstat (limited to 'Mailman/htmlformat.py')
| -rw-r--r-- | Mailman/htmlformat.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py index ae0007794..1bf9548ed 100644 --- a/Mailman/htmlformat.py +++ b/Mailman/htmlformat.py @@ -36,12 +36,11 @@ NL = '\n' # Format an arbitrary object. def HTMLFormatObject(item, indent): "Return a presentation of an object, invoking their Format method if any." - if type(item) == type(''): - return item - elif not hasattr(item, "Format"): - return `item` - else: + if hasattr(item, 'Format'): return item.Format(indent) + if isinstance(item, basestring): + return item + return str(item) def CaseInsensitiveKeyedDict(d): result = {} |
