Browse Source

Fixed error: NameError: name 'unicode' is not defined (Python3)

Anton Linevich 7 years ago
parent
commit
76fd36bd70
1 changed files with 2 additions and 1 deletions
  1. 2 1
      simple_footnotes/simple_footnotes.py

+ 2 - 1
simple_footnotes/simple_footnotes.py

@@ -3,6 +3,7 @@
 
 from pelican import signals
 import html5lib
+import six
 
 RAW_FOOTNOTE_CONTAINERS = ["code"]
 
@@ -56,7 +57,7 @@ def parse_for_footnotes(article_or_page_generator):
                 numbera = dom.createElement(u"a")
                 numbera.setAttribute(u"href", u"#%s" % fnid)
                 numbera.setAttribute(u"class", u"simple-footnote")
-                numbera.appendChild(dom.createTextNode(unicode(count)))
+                numbera.appendChild(dom.createTextNode(six.text_type(count)))
                 txt = getText(footnote, recursive=True).replace(u"\n", u" ")
                 numbera.setAttribute(u"title", txt)
                 number.appendChild(numbera)