mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-15 11:51:02 +00:00
Merge pull request #286 from cjmayo/python3_35
{python3_35} Python3: fix unichr() in htmlparser
This commit is contained in:
commit
44944754d5
1 changed files with 2 additions and 1 deletions
|
|
@ -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''
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue