diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2005-09-14 08:54:39 +0000 |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2005-09-14 08:54:39 +0000 |
commit | 129314a81c19d14fed97ed73a28d577056512ada (patch) | |
tree | 01fbd23f052d96d1ee833ec73b088e29243c4f00 /Lib/sre_parse.py | |
parent | 7de8c5736e0f0964f757230bb9771ec781ea8141 (diff) | |
download | cpython-129314a81c19d14fed97ed73a28d577056512ada.tar.gz |
Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
considering it exactly like a '*'.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r-- | Lib/sre_parse.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index 33b399ef65..319bf43b33 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -485,6 +485,9 @@ def _parse(source, state): elif this == "+": min, max = 1, MAXREPEAT elif this == "{": + if source.next == "}": + subpatternappend((LITERAL, ord(this))) + continue here = source.tell() min, max = 0, MAXREPEAT lo = hi = "" |