mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +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
|
|
@ -224,6 +224,8 @@ class ReTests(unittest.TestCase):
|
|||
self.checkPatternError('(?P<a>)(?P<a>)',
|
||||
"redefinition of group name 'a' as group 2; "
|
||||
"was group 1")
|
||||
self.checkPatternError('(?P<a>(?P=a))',
|
||||
"cannot refer to an open group", 10)
|
||||
self.checkPatternError('(?Pxy)', 'unknown extension ?Px')
|
||||
self.checkPatternError('(?P<a>)(?P=a', 'missing ), unterminated name', 11)
|
||||
self.checkPatternError('(?P=', 'missing group name', 4)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue