diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2020-05-10 13:03:39 -0700 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-11 12:01:28 +0200 |
| commit | d6aff369ad33457ae2355b5b210faf1c4890ff35 (patch) | |
| tree | 4c9d43311078bd81098e8a9fe9ff89fe007e921e /django/http | |
| parent | 23f6fbdd93cd668740e3a1cd6d8c8259f380c0fe (diff) | |
Refs #30116 -- Simplified regex match group access with Match.__getitem__().
The method has been available since Python 3.6. The shorter syntax is
also marginally faster.
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/response.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/http/response.py b/django/http/response.py index 37fa10650d..e00bcacefb 100644 --- a/django/http/response.py +++ b/django/http/response.py @@ -81,7 +81,7 @@ class HttpResponseBase: matched = _charset_from_content_type_re.search(content_type) if matched: # Extract the charset and strip its double quotes - return matched.group('charset').replace('"', '') + return matched['charset'].replace('"', '') return settings.DEFAULT_CHARSET @charset.setter |
