mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
-- added recursion limit (currently ~10,000 levels)
-- improved error messages -- factored out SRE_COUNT; the same code is used by SRE_OP_REPEAT_ONE_TEMPLATE -- minor cleanups
This commit is contained in:
parent
16b1ad9c7d
commit
96ab46529b
4 changed files with 183 additions and 158 deletions
|
@ -264,6 +264,16 @@ for flags in [sre.I, sre.M, sre.X, sre.S, sre.L, sre.T, sre.U]:
|
|||
except:
|
||||
print 'Exception raised on flag', flags
|
||||
|
||||
if verbose:
|
||||
print 'Test engine limitations'
|
||||
|
||||
# Try nasty case that overflows the straightforward recursive
|
||||
# implementation of repeated groups.
|
||||
try:
|
||||
assert sre.match('(x)*', 50000*'x').span() == (0, 50000)
|
||||
except RuntimeError, v:
|
||||
print v
|
||||
|
||||
from re_tests import *
|
||||
|
||||
if verbose:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue