summaryrefslogtreecommitdiff
path: root/Lib/sre_parse.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2005-09-14 08:54:39 +0000
committerGustavo Niemeyer <gustavo@niemeyer.net>2005-09-14 08:54:39 +0000
commit129314a81c19d14fed97ed73a28d577056512ada (patch)
tree01fbd23f052d96d1ee833ec73b088e29243c4f00 /Lib/sre_parse.py
parent7de8c5736e0f0964f757230bb9771ec781ea8141 (diff)
downloadcpython-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.py3
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 = ""