1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-03 11:03:32 +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

@@ -2,7 +2,7 @@ import struct
from io import BytesIO
from collections import defaultdict
from ebook_converter.polyglot.builtins import iteritems, itervalues, unicode_type, as_bytes
from ebook_converter.polyglot.builtins import iteritems, itervalues, as_bytes
__license__ = 'GPL v3'
@@ -394,7 +394,7 @@ def get_bmp_glyph_ids(table, bmp, codes):
def get_glyph_ids(raw, text, raw_is_table=False):
if not isinstance(text, unicode_type):
if not isinstance(text, str):
raise TypeError('%r is not a unicode object'%text)
if raw_is_table:
table = raw
@@ -420,7 +420,7 @@ def get_glyph_ids(raw, text, raw_is_table=False):
def supports_text(raw, text, has_only_printable_chars=False):
if not isinstance(text, unicode_type):
if not isinstance(text, str):
raise TypeError('%r is not a unicode object'%text)
if not has_only_printable_chars:
text = get_printable_characters(text)