1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-07 13:33:33 +02:00

Removed polyglots unicode_type usage

This commit is contained in:
2020-04-20 19:25:28 +02:00
parent ef7e2b10be
commit 128705f258
130 changed files with 657 additions and 716 deletions

View File

@@ -6,7 +6,6 @@ from ebook_converter import prepare_string_for_xml
from ebook_converter.constants import preferred_encoding
from ebook_converter.ebooks.BeautifulSoup import html5_parser
from ebook_converter.utils.html2text import html2text
from ebook_converter.polyglot.builtins import unicode_type
# Hackish - ignoring sentences ending or beginning in numbers to avoid
@@ -44,7 +43,7 @@ def comments_to_html(comments):
'''
if not comments:
return u'<p></p>'
if not isinstance(comments, unicode_type):
if not isinstance(comments, str):
comments = comments.decode(preferred_encoding, 'replace')
if comments.lstrip().startswith('<'):