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:
committed by
Mariusz Felisiak
parent
23f6fbdd93
commit
d6aff369ad
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user