From 27fb89d38aa2abd862d44c67510e1c57be38fcc2 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Tue, 24 Jun 2025 13:38:18 +0200 Subject: [PATCH] Avoid syntax warning in newer python versions Parser does not realize that these regular expressions are part of comments --- src/sysmisc.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sysmisc.py b/src/sysmisc.py index 3a2b0cd..47d6d43 100644 --- a/src/sysmisc.py +++ b/src/sysmisc.py @@ -54,7 +54,7 @@ The library exports the symbols below and some custom logging functions. import re import sysmisc def parse(line): - if re.match(r'\d', line): + if re.match('\\d', line): print('found digits in line!') sysmisc.read_linewise('dump_db', parse) @@ -415,7 +415,7 @@ def replace_file_regex(edited_file, value, regex=None, ignore_fail=False): in order to avoid any mismatch. Example: - provider.cnf, 'PROVIDER_LOCALIP,0: "(\d+)"', 127.0.0.1 + provider.cnf, 'PROVIDER_LOCALIP,0: "(\\d+)"', 127.0.0.1 """ pattern = regex.encode() if regex else "(.+)" -- 1.7.1