Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(124839)

Unified Diff: Lib/sre_parse.py

Issue 12759: "(?P=)" input for Tools/scripts/redemo.py raises unnhandled exception
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/test/test_re.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/sre_parse.py Thu Nov 01 14:52:03 2012 +0200
+++ b/Lib/sre_parse.py Thu Nov 01 21:46:28 2012 +0200
@@ -580,6 +580,8 @@
break
name = name + char
group = 1
+ if not name:
+ raise error("bad group name")
if not isname(name):
raise error("bad character in group name")
elif sourcematch("="):
@@ -592,6 +594,8 @@
if char == ")":
break
name = name + char
+ if not name:
+ raise error("bad group name")
if not isname(name):
raise error("bad character in group name")
gid = state.groupdict.get(name)
@@ -644,6 +648,8 @@
break
condname = condname + char
group = 2
+ if not condname:
+ raise error("bad group name")
if isname(condname):
condgroup = state.groupdict.get(condname)
if condgroup is None:
« no previous file with comments | « no previous file | Lib/test/test_re.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+