Fixes to get tests passing in Python 3.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
from bs4 import BeautifulSoup, NavigableString
|
from bs4 import BeautifulSoup, NavigableString
|
||||||
import re
|
import re
|
||||||
|
import six
|
||||||
|
|
||||||
|
|
||||||
convert_heading_re = re.compile(r'convert_h(\d+)')
|
convert_heading_re = re.compile(r'convert_h(\d+)')
|
||||||
@@ -61,7 +62,7 @@ class MarkdownConverter(object):
|
|||||||
# Convert the children first
|
# Convert the children first
|
||||||
for el in node.children:
|
for el in node.children:
|
||||||
if isinstance(el, NavigableString):
|
if isinstance(el, NavigableString):
|
||||||
text += self.process_text(unicode(el))
|
text += self.process_text(six.text_type(el))
|
||||||
else:
|
else:
|
||||||
text += self.process_tag(el)
|
text += self.process_tag(el)
|
||||||
|
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -9,7 +9,7 @@ read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
|||||||
|
|
||||||
|
|
||||||
pkgmeta = {}
|
pkgmeta = {}
|
||||||
execfile(os.path.join(os.path.dirname(__file__), 'markdownify', 'pkgmeta.py'),
|
exec(open(os.path.join(os.path.dirname(__file__), 'markdownify', 'pkgmeta.py')).read(),
|
||||||
pkgmeta)
|
pkgmeta)
|
||||||
|
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ setup(
|
|||||||
'pytest',
|
'pytest',
|
||||||
],
|
],
|
||||||
install_requires=[
|
install_requires=[
|
||||||
'beautifulsoup4',
|
'beautifulsoup4', 'six'
|
||||||
],
|
],
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Environment :: Web Environment',
|
'Environment :: Web Environment',
|
||||||
|
|||||||
Reference in New Issue
Block a user