mirror of
https://github.com/django/django.git
synced 2025-09-22 18:22:40 +00:00
[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:
parent
0d914d08a0
commit
ca07fda2ef
24 changed files with 54 additions and 48 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue