Merge pull request #286 from cjmayo/python3_35

{python3_35} Python3: fix unichr() in htmlparser
This commit is contained in:
anarcat 2019-09-11 09:48:35 -04:00 committed by GitHub
commit 44944754d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,6 +165,7 @@ try:
from htmlentitydefs import name2codepoint
except ImportError:
from html.entities import name2codepoint
from builtins import chr
def _resolve_entity (mo):
@ -193,7 +194,7 @@ def _resolve_entity (mo):
# unknown entity -> ignore
return u''
try:
return unichr(num)
return chr(num)
except ValueError:
return u''