summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-04-22 18:09:30 (GMT)
committerGitHub <noreply@github.com>2022-04-22 18:09:30 (GMT)
commit080781cd49b13da4a73db87b6f5e0c7aeec83e92 (patch)
treefda64bfab4afd96dd7a12360f857eaefc3303877 /Misc
parent9c18d783c38fca57a63b61aa778d8a8d18945d95 (diff)
downloadcpython-080781cd49b13da4a73db87b6f5e0c7aeec83e92.zip
cpython-080781cd49b13da4a73db87b6f5e0c7aeec83e92.tar.gz
cpython-080781cd49b13da4a73db87b6f5e0c7aeec83e92.tar.bz2
[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)
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2022-04-19-17-30-17.gh-issue-91700.MRJi6m.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2022-04-19-17-30-17.gh-issue-91700.MRJi6m.rst b/Misc/NEWS.d/next/Library/2022-04-19-17-30-17.gh-issue-91700.MRJi6m.rst
new file mode 100644
index 0000000..73b1068
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-04-19-17-30-17.gh-issue-91700.MRJi6m.rst
@@ -0,0 +1,4 @@
+Compilation of regular expression containing a conditional expression
+``(?(group)...)`` now raises an appropriate :exc:`re.error` if the group
+number refers to not defined group. Previously an internal RuntimeError was
+raised.