]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.10] gh-91700: Validate the group number in conditional expression in RE (GH-91702...
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 22 Apr 2022 18:09:30 +0000 (21:09 +0300)
committerGitHub <noreply@github.com>
Fri, 22 Apr 2022 18:09:30 +0000 (21:09 +0300)
commit080781cd49b13da4a73db87b6f5e0c7aeec83e92
treefda64bfab4afd96dd7a12360f857eaefc3303877
parent9c18d783c38fca57a63b61aa778d8a8d18945d95
[3.10] gh-91700: Validate the group number in conditional expression in RE (GH-91702) (GH-91831)

In expression (?(group)...) an appropriate re.error is now
raised if the group number refers to not defined group.

Previously it raised RuntimeError: invalid SRE code.
(cherry picked from commit 48ec61a89a959071206549819448405c2cea61b0)
Lib/sre_parse.py
Lib/test/test_re.py
Misc/NEWS.d/next/Library/2022-04-19-17-30-17.gh-issue-91700.MRJi6m.rst [new file with mode: 0644]