[py3] Switched to Python 3-compatible imports.

xrange/range will be dealt with in a separate commit due to the huge
number of changes.
This commit is contained in:
Aymeric Augustin 2012-07-20 16:16:57 +02:00
parent 0d914d08a0
commit ca07fda2ef
24 changed files with 54 additions and 48 deletions

View file

@ -4,7 +4,7 @@ import re
import unicodedata
import warnings
from gzip import GzipFile
from htmlentitydefs import name2codepoint
from django.utils.six.moves import html_entities
from io import BytesIO
from django.utils.encoding import force_unicode
@ -349,7 +349,7 @@ def _replace_entity(match):
return match.group(0)
else:
try:
return unichr(name2codepoint[text])
return unichr(html_entities.name2codepoint[text])
except (ValueError, KeyError):
return match.group(0)