Mercurial > public > mercurial-scm > hg
diff tests/test-help.t @ 50304:805d4a462abb stable
py3: fix for Python 3.12 emitting SyntaxWarning on invalid escape sequences
Mercurial became very noisy after https://github.com/python/cpython/commit/a60ddd31be7ff96a8189e7483bf1eb2071d2bddf ,
for example:
$ python3.12 mercurial/store.py
mercurial/store.py:406: SyntaxWarning: invalid escape sequence '\.'
EXCLUDED = re.compile(b'.*undo\.[^/]+\.(nd?|i)$')
This verbosity made some tests fail.
The problems were mostly insufficiently escaped regexps, relying on the Python
parser/scanner preserving invalid escape sequences.
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 07 Mar 2023 16:45:54 +0100 |
parents | 2282d8ac0fa9 |
children | f0d2b18f0274 |
line wrap: on
line diff
--- a/tests/test-help.t Tue Mar 07 16:25:51 2023 +0100 +++ b/tests/test-help.t Tue Mar 07 16:45:54 2023 +0100 @@ -1988,7 +1988,7 @@ $ "$PYTHON" <<EOF > def escape(s): - > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932')) + > return b''.join(br'\\u%x' % ord(uc) for uc in s.decode('cp932')) > # translation of "record" in ja_JP.cp932 > upper = b"\x8bL\x98^" > # str.lower()-ed section name should be treated as different one