summaryrefslogtreecommitdiff
path: root/django/utils/datastructures.py
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2023-01-18 19:11:18 +0100
committerGitHub <noreply@github.com>2023-01-18 19:11:18 +0100
commit23e886886249ebe8f80a48b0d25fbb5308eeb06f (patch)
treeddd2eb220750704fa4fbfd8447654fc3d382bd10 /django/utils/datastructures.py
parentfd21f82aa82b0d75a161f618ef944ebe0923e0ab (diff)
Refs #34233 -- Used str.removeprefix()/removesuffix().
Diffstat (limited to 'django/utils/datastructures.py')
-rw-r--r--django/utils/datastructures.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
index 51a586d152..ded606d02a 100644
--- a/django/utils/datastructures.py
+++ b/django/utils/datastructures.py
@@ -276,8 +276,7 @@ class DictWrapper(dict):
before returning, otherwise return the raw value.
"""
use_func = key.startswith(self.prefix)
- if use_func:
- key = key[len(self.prefix) :]
+ key = key.removeprefix(self.prefix)
value = super().__getitem__(key)
if use_func:
return self.func(value)