src/reportlab/platypus/paraparser.py
branchpy33
changeset 3955 3dbd805c708c
parent 3954 44dbe56eb858
child 3956 486cc75f4cdb
--- a/src/reportlab/platypus/paraparser.py	Mon Dec 30 14:30:06 2013 +0000
+++ b/src/reportlab/platypus/paraparser.py	Mon Dec 30 21:13:16 2013 +0000
@@ -18,15 +18,19 @@
 import unicodedata
 import reportlab.lib.sequencer
 
-from html.parser import HTMLParser
-from html.entities import name2codepoint
-
 from reportlab.lib.abag import ABag
 from reportlab.lib.utils import ImageReader, isPy3, annotateException, encode_label, asUnicode
 from reportlab.lib.colors import toColor, white, black, red, Color
 from reportlab.lib.fonts import tt2ps, ps2tt
 from reportlab.lib.enums import TA_LEFT, TA_RIGHT, TA_CENTER, TA_JUSTIFY
 from reportlab.lib.units import inch,mm,cm,pica
+if isPy3:
+    from html.parser import HTMLParser
+    from html.entities import name2codepoint
+else:
+    from HTMLParser import HTMLParser
+    from htmlentitydefs import name2codepoint
+
 _re_para = re.compile(r'^\s*<\s*para(?:\s+|>|/>)')
 
 sizeDelta = 2       # amount to reduce font size by for super and sub script