aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Boris Muratov <[email protected]>2021-02-26 15:17:16 +0200
committerGravatar Boris Muratov <[email protected]>2021-02-26 15:17:16 +0200
commit80153ed12d20ccaa637a55765df60d8d3b5e64ef (patch)
treec1d9c3f59a9be99b4aa8582c4b0dc92235324b0f
parentSupressing any exceptions while updating the threshold in redis (diff)
Changed name of _duration_parser constant to uppercase
-rw-r--r--bot/utils/time.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bot/utils/time.py b/bot/utils/time.py
index a7b441327..f862e40f7 100644
--- a/bot/utils/time.py
+++ b/bot/utils/time.py
@@ -9,7 +9,7 @@ from dateutil.relativedelta import relativedelta
RFC1123_FORMAT = "%a, %d %b %Y %H:%M:%S GMT"
INFRACTION_FORMAT = "%Y-%m-%d %H:%M"
-_duration_parser = re.compile(
+_DURATION_REGEX = re.compile(
r"((?P<years>\d+?) ?(years|year|Y|y) ?)?"
r"((?P<months>\d+?) ?(months|month|m) ?)?"
r"((?P<weeks>\d+?) ?(weeks|week|W|w) ?)?"
@@ -100,7 +100,7 @@ def parse_duration_string(duration: str) -> Optional[relativedelta]:
The units need to be provided in descending order of magnitude.
If the string does represent a durationdelta object, it will return None.
"""
- match = _duration_parser.fullmatch(duration)
+ match = _DURATION_REGEX.fullmatch(duration)
if not match:
return None