1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-03-12 20:45:47 +01: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

@@ -7,7 +7,7 @@ import json
from gettext import GNUTranslations, NullTranslations
import pkg_resources
from ebook_converter.polyglot.builtins import is_py3, iteritems, unicode_type
from ebook_converter.polyglot.builtins import is_py3, iteritems
_available_translations = None
@@ -253,7 +253,7 @@ def calibre_langcode_to_name(lc, localize=True):
def canonicalize_lang(raw):
if not raw:
return None
if not isinstance(raw, unicode_type):
if not isinstance(raw, str):
raw = raw.decode('utf-8', 'ignore')
raw = raw.lower().strip()
if not raw: