diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-08-01 05:30:20 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-08-01 14:30:20 +0200 |
| commit | e8d0d2a5efc8012dcc8bf1809dec065ebde64c81 (patch) | |
| tree | 90a7055f12cf2174a51a5ca0332b4de154e7a89b /django/utils/text.py | |
| parent | ff111ea5e39cf774b3cd4237790d2bffd2826fb0 (diff) | |
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.
Diffstat (limited to 'django/utils/text.py')
| -rw-r--r-- | django/utils/text.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |
