summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-07-18 20:27:00 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-07-18 20:27:00 (GMT)
commit485407ce1e4dc3b2005bc1c72ce6020c28f90030 (patch)
tree8082f5971a787e457c46b85c17030b53e4b13a46 /Lib/test/test_re.py
parent2489bd5d4e45b2a1d90f9336bf528ab1bba2d796 (diff)
downloadcpython-485407ce1e4dc3b2005bc1c72ce6020c28f90030.zip
cpython-485407ce1e4dc3b2005bc1c72ce6020c28f90030.tar.gz
cpython-485407ce1e4dc3b2005bc1c72ce6020c28f90030.tar.bz2
Issue #24580: Symbolic group references to open group in re patterns now are
explicitly forbidden as well as numeric group references.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 5b71612..7a74141 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -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)