From 2864540445fb1bbf7791e5eea9315b952b6264fd Mon Sep 17 00:00:00 2001 From: Dominik Mierzejewski Date: Tue, 21 Nov 2023 15:32:19 +0100 Subject: [PATCH] Pass `count` as keyword argument to `re.sub()` This fixes two test failures under Python 3.13: ``` Failed Tests (2): FileCheck.py integration tests :: tests/extra_features/pseudo_numeric_variables/01_line_variable_once/test.itest FileCheck.py integration tests :: tests/extra_features/pseudo_numeric_variables/02_line_variable_twice/test.itest ``` Both are failing due to: ``` filecheck/filecheck.py:372: DeprecationWarning: 'count' is passed as positional argument ``` Passing `count` as positional argument to `re.sub()` has been deprecated in Python 3.13: https://docs.python.org/3.13/whatsnew/3.13.html#id9 and produces a `DeprecationWarning` exception. --- filecheck/filecheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filecheck/filecheck.py b/filecheck/filecheck.py index 523afc4..3cd8368 100755 --- a/filecheck/filecheck.py +++ b/filecheck/filecheck.py @@ -374,7 +374,7 @@ def parse_check(line: str, line_idx, config: Config) -> Optional[Check]: LINE_NUMBER_REGEX, str(line_idx + offset + 1), check_expression, - 1, + count=1, ) line_var_match = re.search(LINE_NUMBER_REGEX, check_expression)