Commit f01fc519 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Bug #1526834] Fix crash in pdb when you do 'b f(';

the function name was placed into a regex pattern and the unbalanced paren
caused re.compile() to report an error
parent a97758e5
......@@ -23,7 +23,7 @@ __all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace",
"post_mortem", "help"]
def find_function(funcname, filename):
cre = re.compile(r'def\s+%s\s*[(]' % funcname)
cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
try:
fp = open(filename)
except IOError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment