]> git.phdru.name Git - xsetbg.git/commitdiff
Style: Fix `flake8` error W605 invalid escape sequence '\d'
authorOleg Broytman <phd@phdru.name>
Sat, 24 Feb 2024 13:58:12 +0000 (16:58 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 24 Feb 2024 14:01:31 +0000 (17:01 +0300)
xsetbg.py

index 706e183ef2cad8338877b5a6c59bfa04a419c2c5..825b20eb0f9c927614a5285d4c8467524b3c5380 100644 (file)
--- 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<years>\d+)y)?'
-                       '(?:(?P<months>\d+)m)?'
-                       '(?:(?P<days>\d+)d)?'
-                       '(?:T(?:(?P<hours>\d+)h)?'
-                       '(?:(?P<minutes>\d+)m)?(?:(?P<seconds>\d+)s)?)?')
+    td_re = re.compile('(?:(?P<years>\\d+)y)?'
+                       '(?:(?P<months>\\d+)m)?'
+                       '(?:(?P<days>\\d+)d)?'
+                       '(?:T(?:(?P<hours>\\d+)h)?'
+                       '(?:(?P<minutes>\\d+)m)?(?:(?P<seconds>\\d+)s)?)?')
     td_dict = td_re.match(min_delay).groupdict(0)
     delta = timedelta(days=int(td_dict['days']) +
                       (int(td_dict['months']) * 30) +