diff options
author | Mats Wichmann <mats@linux.com> | 2024-03-21 17:57:14 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2024-03-21 17:57:14 (GMT) |
commit | 43c652959bff6ce815d7097c7cd1a5af97c96014 (patch) | |
tree | 4c34809af4f7ef59d5d78327bf4c3fc0af6a3a3d /testing | |
parent | 04c86e14b26e945903b49dda8916fd6f8ea880a9 (diff) | |
download | SCons-43c652959bff6ce815d7097c7cd1a5af97c96014.zip SCons-43c652959bff6ce815d7097c7cd1a5af97c96014.tar.gz SCons-43c652959bff6ce815d7097c7cd1a5af97c96014.tar.bz2 |
Fix a Python 3.13 problem in re.sub usage
re.sub's count and flags arguments are transitioning to keyword-only.
With 3.13a5, usage as positional args issues a DeprecationWarning,
which caused one SCons test to fail. Updated in test framework
and in bin/update-release-info.py.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestSCons.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index e07be71..db702c6 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -668,14 +668,14 @@ class TestSCons(TestCommon): return s @staticmethod - def to_bytes_re_sub(pattern, repl, str, count: int=0, flags: int=0): + def to_bytes_re_sub(pattern, repl, string, count: int=0, flags: int=0): """ Wrapper around re.sub to change pattern and repl to bytes to work with both python 2 & 3 """ pattern = to_bytes(pattern) repl = to_bytes(repl) - return re.sub(pattern, repl, str, count, flags) + return re.sub(pattern, repl, string, count=count, flags=flags) def normalize_pdf(self, s): s = self.to_bytes_re_sub(r'/(Creation|Mod)Date \(D:[^)]*\)', |