Commit d221fc2d authored by Rémi Cardona's avatar Rémi Cardona
Browse files

[py3k] Import name2codepoint from six.moves

Related to #268148.
parent cdaa06f45b89
......@@ -35,10 +35,11 @@ import locale
import mimetypes
import re
import string
import htmlentitydefs
import codecs
from io import BytesIO
from six.moves.html_entities import name2codepoint
import chardet
except ImportError:
......@@ -144,7 +145,7 @@ def xml_escape(data):
def html_unescape(data):
"""unescapes XML/HTML entities"""
for entityname, codepoint in htmlentitydefs.name2codepoint.iteritems():
for entityname, codepoint in name2codepoint.items():
data = data.replace('&%s;' % entityname, unichr(codepoint))
return data.replace(''', "'")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment