mirror of https://github.com/python/cpython.git
Will backport to 2.2.
This commit is contained in:
parent
910ae6283a
commit
53d93adc46
|
@ -254,7 +254,7 @@ def _class_escape(source, escape):
|
|||
if len(escape) != 2:
|
||||
raise error, "bogus escape: %s" % repr("\\" + escape)
|
||||
return LITERAL, atoi(escape, 16) & 0xff
|
||||
elif str(escape[1:2]) in OCTDIGITS:
|
||||
elif escape[1:2] in OCTDIGITS:
|
||||
# octal escape (up to three digits)
|
||||
while source.next in OCTDIGITS and len(escape) < 5:
|
||||
escape = escape + source.get()
|
||||
|
|
|
@ -96,6 +96,10 @@ def test(expression, result, exception=None):
|
|||
# non-simple '*?' still recurses and hits the recursion limit
|
||||
test(r"""sre.search('(a|b)*?c', 10000*'ab'+'cd').end(0)""", None, RuntimeError)
|
||||
|
||||
# bug 612074
|
||||
pat=u"["+sre.escape(u"\u2039")+u"]"
|
||||
test(r"""sre.compile(pat) and 1""", 1, None)
|
||||
|
||||
if verbose:
|
||||
print 'Running tests on sre.sub'
|
||||
|
||||
|
|
Loading…
Reference in New Issue