mirror of
https://github.com/django/django.git
synced 2025-03-31 11:37:06 +00:00
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…
x
Reference in New Issue
Block a user