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 --- test/RegressTests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/RegressTests.py') diff --git a/test/RegressTests.py b/test/RegressTests.py index 1804d32e..526c8f7c 100755 --- a/test/RegressTests.py +++ b/test/RegressTests.py @@ -61,7 +61,7 @@ class RegressFile(object): while line: if line.startswith("test "): command = line[5:] - match = re.match('(.*) -> ([0-9]+)', command) + match = re.match(r'(.*) -> ([0-9]+)', command) if match: test.command = self.transform_line(match.group(1)) test.exitcode = int(match.group(2)) @@ -106,13 +106,13 @@ class RegressFile(object): return if test.command.find('-f ') != -1: test.command = '$ledger ' + test.command - if re.search('-f (-|/dev/stdin)(\s|$)', test.command): + if re.search(r'-f (-|/dev/stdin)(\s|$)', test.command): use_stdin = True else: test.command = f'$ledger -f "{str(self.filename.resolve())}" {test.command}' p = harness.run(test.command, - columns=(not re.search('--columns', test.command))) + columns=(not re.search(r'--columns', test.command))) if use_stdin: fd = open(self.filename, encoding='utf-8') -- cgit v1.2.3