Mercurial > hg-stable
changeset 51714:c6e4fec01775 stable
subrepoutil: pass re.sub 'count' argument by name
Python 3.13 started warning:
DeprecationWarning: 'count' is passed as positional argument
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Thu, 11 Jan 2024 21:58:55 +0100 |
parents | 4fbee56e854a |
children | 5ac506ee6690 |
files | mercurial/subrepoutil.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/subrepoutil.py Thu Jan 11 21:58:55 2024 +0100 +++ b/mercurial/subrepoutil.py Thu Jan 11 21:58:55 2024 +0100 @@ -131,7 +131,7 @@ # extra escapes are needed because re.sub string decodes. repl = re.sub(br'\\\\([0-9]+)', br'\\\1', repl) try: - src = re.sub(pattern, repl, src, 1) + src = re.sub(pattern, repl, src, count=1) except re.error as e: raise error.Abort( _(b"bad subrepository pattern in %s: %s")