diff --git a/django/utils/text.py b/django/utils/text.py index c2576b012a..03e2d05177 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -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)