mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Fixed too ambitious "nothing to repeat" check. Closes bug #114033.
This commit is contained in:
parent
5c0b43d1e2
commit
13ac9926ac
4 changed files with 6 additions and 3 deletions
|
|
@ -222,7 +222,7 @@ def _optimize_charset(charset, fixup):
|
|||
def _simple(av):
|
||||
# check if av is a "simple" operator
|
||||
lo, hi = av[2].getwidth()
|
||||
if lo == 0:
|
||||
if lo == 0 and hi == MAXREPEAT:
|
||||
raise error, "nothing to repeat"
|
||||
return lo == hi == 1 and av[2][0][0] != SUBPATTERN
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue