summaryrefslogtreecommitdiff
path: root/django/utils/datetime_safe.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2020-05-10 13:03:39 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-11 12:01:28 +0200
commitd6aff369ad33457ae2355b5b210faf1c4890ff35 (patch)
tree4c9d43311078bd81098e8a9fe9ff89fe007e921e /django/utils/datetime_safe.py
parent23f6fbdd93cd668740e3a1cd6d8c8259f380c0fe (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/utils/datetime_safe.py')
-rw-r--r--django/utils/datetime_safe.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/datetime_safe.py b/django/utils/datetime_safe.py
index 7edd96f2f1..8c87c825d6 100644
--- a/django/utils/datetime_safe.py
+++ b/django/utils/datetime_safe.py
@@ -76,7 +76,7 @@ def strftime(dt, fmt):
return super(type(dt), dt).strftime(fmt)
illegal_formatting = _illegal_formatting.search(fmt)
if illegal_formatting:
- raise TypeError("strftime of dates before 1000 does not handle " + illegal_formatting.group(0))
+ raise TypeError('strftime of dates before 1000 does not handle ' + illegal_formatting[0])
year = dt.year
# For every non-leap year century, advance by