From: Oleg Broytman Date: Sat, 24 Feb 2024 13:58:12 +0000 (+0300) Subject: Style: Fix `flake8` error W605 invalid escape sequence '\d' X-Git-Tag: 5.1.0~5 X-Git-Url: https://git.phdru.name/?p=xsetbg.git;a=commitdiff_plain;h=fec6af560d298673f870595a21f002acf884f042 Style: Fix `flake8` error W605 invalid escape sequence '\d' --- 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) +