diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 9b44d47..442e5e2 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -1,5 +1,6 @@ from bs4 import BeautifulSoup, NavigableString import re +import six convert_heading_re = re.compile(r'convert_h(\d+)') @@ -61,7 +62,7 @@ class MarkdownConverter(object): # Convert the children first for el in node.children: if isinstance(el, NavigableString): - text += self.process_text(unicode(el)) + text += self.process_text(six.text_type(el)) else: text += self.process_tag(el) diff --git a/setup.py b/setup.py index 7a3414c..0baa1f6 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read() 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) @@ -75,7 +75,7 @@ setup( 'pytest', ], install_requires=[ - 'beautifulsoup4', + 'beautifulsoup4', 'six' ], classifiers=[ 'Environment :: Web Environment',