Skip to content

Commit e672825

Browse files
committed
[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
1 parent a5453c4 commit e672825

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"post_mortem", "help"]
2424

2525
def find_function(funcname, filename):
26-
cre = re.compile(r'def\s+%s\s*[(]' % funcname)
26+
cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
2727
try:
2828
fp = open(filename)
2929
except IOError:

0 commit comments

Comments
 (0)