mirror of https://github.com/django/django.git
Removed unneeded ValueError catching in django.utils.text._replace_entity().
The html.entities.name2codepoint dict contains only valid Unicode codepoints. Either the key exists and chr() will succeed or the key does not exist.
This commit is contained in:
parent
ff111ea5e3
commit
e8d0d2a5ef
|
@ -351,7 +351,7 @@ def _replace_entity(match):
|
|||
else:
|
||||
try:
|
||||
return chr(html.entities.name2codepoint[text])
|
||||
except (ValueError, KeyError):
|
||||
except KeyError:
|
||||
return match.group(0)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue