aboutsummaryrefslogtreecommitdiff
path: root/mammoth
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2013-12-14 18:09:54 +0000
committerMichael Williamson <mike@zwobble.org>2013-12-14 18:09:54 +0000
commit5f9f209d6b9971785b6082dcb4276ae2c4ba7859 (patch)
treed6ad87d914e5aa9f3c7ae8253ddc7617980ae94f /mammoth
parent0c8ee31a154b5e624f207fb1413295ef2bf45417 (diff)
Add Python 3.2 support
Diffstat (limited to 'mammoth')
-rw-r--r--mammoth/html_generation.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mammoth/html_generation.py b/mammoth/html_generation.py
index f6f62af..8395a3d 100644
--- a/mammoth/html_generation.py
+++ b/mammoth/html_generation.py
@@ -45,7 +45,7 @@ class HtmlGenerator(object):
self._fragments.append(fragment)
def html_string(self):
- return u"".join(self._fragments)
+ return u("").join(self._fragments)
class _Element(object):
@@ -106,5 +106,9 @@ def _generate_class_attribute(path_element):
if sys.version_info[0] == 2:
_iteritems = lambda x: x.iteritems()
+ u = lambda value: unicode(value, "unicode_escape")
+
else:
_iteritems = lambda x: x.items()
+ u = lambda value: value
+