Skip to content

Commit c3be4a3

Browse files
tchaikovxemul
authored andcommitted
test.py: pass "count" to re.sub() with kwarg
since Python 3.13, passing count to `re.sub()` as positional argument has been deprecated. and when runnint `test.py` with Python 3.13, we have following warning: ``` /home/kefu/dev/scylladb/./test.py:1477: DeprecationWarning: 'count' is passed as positional argument args.tests = set(re.sub(r'.* List configured unit tests\n(.*)\n', r'\1', out, 1, re.DOTALL).split("\n")) ``` see also python/cpython#56166 in order to silence this distracting warning, let's pass `count` using kwarg. Signed-off-by: Kefu Chai <kefu.chai@scylladb.com> Closes #20859
1 parent 947d9d5 commit c3be4a3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎test.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ def prepare_dir(dirname, pattern):
14681468
try:
14691469
out = ninja('unit_test_list')
14701470
# [1/1] List configured unit tests
1471-
args.tests = set(re.sub(r'.* List configured unit tests\n(.*)\n', r'\1', out, 1, re.DOTALL).split("\n"))
1471+
args.tests = set(re.sub(r'.* List configured unit tests\n(.*)\n', r'\1', out, count=1, flags=re.DOTALL).split("\n"))
14721472
except Exception:
14731473
print(palette.fail("Failed to read output of `ninja unit_test_list`: please run ./configure.py first"))
14741474
raise

0 commit comments

Comments
 (0)