mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #24580: Symbolic group references to open group in re patterns now are
explicitly forbidden as well as numeric group references.
This commit is contained in:
parent
2489bd5d4e
commit
485407ce1e
3 changed files with 8 additions and 0 deletions
|
@ -675,6 +675,9 @@ def _parse(source, state):
|
|||
if gid is None:
|
||||
msg = "unknown group name %r" % name
|
||||
raise source.error(msg, len(name) + 1)
|
||||
if not state.checkgroup(gid):
|
||||
raise source.error("cannot refer to an open group",
|
||||
len(name) + 1)
|
||||
state.checklookbehindgroup(gid, source)
|
||||
subpatternappend((GROUPREF, gid))
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue