From fec6af560d298673f870595a21f002acf884f042 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 24 Feb 2024 16:58:12 +0300 Subject: [PATCH] Style: Fix `flake8` error W605 invalid escape sequence '\d' --- xsetbg.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xsetbg.py b/xsetbg.py index 706e183..825b20e 100644 --- a/xsetbg.py +++ b/xsetbg.py @@ -50,11 +50,11 @@ if xsetbg_conf.has_option("xsetbg", "min_delay"): min_delay = xsetbg_conf.get("xsetbg", "min_delay") # Borrowed from http://stackoverflow.com/a/2765366 - td_re = re.compile('(?:(?P\d+)y)?' - '(?:(?P\d+)m)?' - '(?:(?P\d+)d)?' - '(?:T(?:(?P\d+)h)?' - '(?:(?P\d+)m)?(?:(?P\d+)s)?)?') + td_re = re.compile('(?:(?P\\d+)y)?' + '(?:(?P\\d+)m)?' + '(?:(?P\\d+)d)?' + '(?:T(?:(?P\\d+)h)?' + '(?:(?P\\d+)m)?(?:(?P\\d+)s)?)?') td_dict = td_re.match(min_delay).groupdict(0) delta = timedelta(days=int(td_dict['days']) + (int(td_dict['months']) * 30) + -- 2.39.5