1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-01-06 11:14:12 +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

@@ -15,7 +15,7 @@ import operator
import string
from ebook_converter.css_selectors.errors import SelectorSyntaxError, ExpressionError
from ebook_converter.polyglot.builtins import unicode_type, codepoint_to_chr
from ebook_converter.polyglot.builtins import codepoint_to_chr
utab = {c:c+32 for c in range(ord(u'A'), ord(u'Z')+1)}
@@ -25,7 +25,7 @@ if sys.version_info.major < 3:
def ascii_lower(string):
"""Lower-case, but only in the ASCII range."""
return string.translate(utab if isinstance(string, unicode_type) else tab)
return string.translate(utab if isinstance(string, str) else tab)
def urepr(x):
if isinstance(x, list):
@@ -469,7 +469,7 @@ def parse_simple_selector(stream, inside_negation=False):
if ident.lower() in special_pseudo_elements:
# Special case: CSS 2.1 pseudo-elements can have a single ':'
# Any new pseudo-element must have two.
pseudo_element = unicode_type(ident)
pseudo_element = str(ident)
continue
if stream.peek() != ('DELIM', '('):
result = Pseudo(result, ident)