Mercurial > hg-stable
changeset 51713:4fbee56e854a stable
tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position
This bug was caught by the new Python 3.13 warning:
DeprecationWarning: 'count' is passed as positional argument
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 11 Jan 2024 21:58:55 +0100 |
parents | a26a05199070 |
children | c6e4fec01775 |
files | tests/test-doctest.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-doctest.py Thu Jun 29 20:02:27 2023 +0200 +++ b/tests/test-doctest.py Thu Jan 11 21:58:55 2024 +0100 @@ -21,9 +21,11 @@ r'''^mercurial\.\w+\.(\w+): (['"])(.*?)\2''', r'\1: \3', got2, - re.MULTILINE, + flags=re.MULTILINE, ) - got2 = re.sub(r'^mercurial\.\w+\.(\w+): ', r'\1: ', got2, re.MULTILINE) + got2 = re.sub( + r'^mercurial\.\w+\.(\w+): ', r'\1: ', got2, flags=re.MULTILINE + ) return any( doctest.OutputChecker.check_output(self, w, g, optionflags) for w, g in [(want, got), (want2, got2)]