Skip to content

Commit

Permalink
test.py: pass "count" to re.sub() with kwarg
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
tchaikov committed Sep 27, 2024
1 parent 9af43dc commit 8b833d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ def prepare_dir(dirname, pattern):
try:
out = ninja('unit_test_list')
# [1/1] List configured unit tests
args.tests = set(re.sub(r'.* List configured unit tests\n(.*)\n', r'\1', out, 1, re.DOTALL).split("\n"))
args.tests = set(re.sub(r'.* List configured unit tests\n(.*)\n', r'\1', out, count=1, flags=re.DOTALL).split("\n"))
except Exception:
print(palette.fail("Failed to read output of `ninja unit_test_list`: please run ./configure.py first"))
raise
Expand Down

0 comments on commit 8b833d8

Please sign in to comment.