This commit is contained in:
Miroslav Stampar
2019-09-16 10:03:19 +02:00
parent b51f02c2ca
commit ad785ea0a2
2 changed files with 4 additions and 2 deletions

View File

@@ -227,6 +227,9 @@ def unescape(data, entities, encoding=DEFAULT_ENCODING):
if data is None or "&" not in data:
return data
if isinstance(data, six.string_types):
encoding = None
def replace_entities(match, entities=entities, encoding=encoding):
ent = match.group()
if ent[1] == "#":
@@ -279,7 +282,6 @@ def get_entitydefs():
entitydefs["&%s;" % name] = _unichr(codepoint)
return entitydefs
def issequence(x):
try:
x[0]