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.
@@ -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)
