From 815305b94864556c994934c7a7c830da7de1d94e Mon Sep 17 00:00:00 2001 From: Alexis Hildebrandt Date: Sun, 25 Feb 2024 17:40:19 +0100 Subject: Use Python raw strings for regex methods argument --- acprep | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'acprep') diff --git a/acprep b/acprep index 13032e39..70b28e03 100755 --- a/acprep +++ b/acprep @@ -413,16 +413,16 @@ class PrepareBuild(CommandLineApp): version_m4 = open('CMakeLists.txt', 'r') for line in version_m4.readlines(): - match = re.match('^set\(Ledger_VERSION_MAJOR ([0-9]+)\)', line) + match = re.match(r'^set\(Ledger_VERSION_MAJOR ([0-9]+)\)', line) if match: major = match.group(1) - match = re.match('^set\(Ledger_VERSION_MINOR ([0-9]+)\)', line) + match = re.match(r'^set\(Ledger_VERSION_MINOR ([0-9]+)\)', line) if match: minor = match.group(1) - match = re.match('^set\(Ledger_VERSION_PATCH ([0-9]+)\)', line) + match = re.match(r'^set\(Ledger_VERSION_PATCH ([0-9]+)\)', line) if match: patch = match.group(1) - match = re.match('^set\(Ledger_VERSION_DATE ([0-9]+)\)', line) + match = re.match(r'^set\(Ledger_VERSION_DATE ([0-9]+)\)', line) if match: date = match.group(1) break @@ -840,7 +840,7 @@ class PrepareBuild(CommandLineApp): PrepareBuild.__dict__['setup_flavor_' + self.current_flavor](self) def escape_string(self, data): - return re.sub('(["\\\\])', '\\\\\\1', data) + return re.sub(r'(['\\\\])', '\\\\\\1', data) def finalize_config(self): self.setup_flavor() -- cgit v1.2.3