1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-21 13:41:30 +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
+1 -2
View File
@@ -7,7 +7,6 @@ from ebook_converter import xml_replace_entities
from ebook_converter.utils.xml_parse import safe_xml_fromstring
from ebook_converter.ebooks.chardet import xml_to_unicode, strip_encoding_declarations
from ebook_converter.utils.cleantext import clean_xml_chars
from ebook_converter.polyglot.builtins import unicode_type
__license__ = 'GPL v3'
@@ -81,7 +80,7 @@ def parse(raw, decoder=None, log=None, line_numbers=True, linenumber_attribute=N
if linenumber_attribute:
for elem in ans.iter(LxmlElement):
if elem.sourceline is not None:
elem.set(linenumber_attribute, unicode_type(elem.sourceline))
elem.set(linenumber_attribute, str(elem.sourceline))
return ans
except Exception:
if log is not None: