1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

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.
This commit is contained in:
Jon Dufresne
2020-05-10 13:03:39 -07:00
committed by Mariusz Felisiak
parent 23f6fbdd93
commit d6aff369ad
36 changed files with 92 additions and 92 deletions

View File

@@ -363,7 +363,7 @@ class RequestFactory:
# Encode the content so that the byte representation is correct.
match = CONTENT_TYPE_RE.match(content_type)
if match:
charset = match.group(1)
charset = match[1]
else:
charset = settings.DEFAULT_CHARSET
return force_bytes(data, encoding=charset)