]> granicus.if.org Git - python/commitdiff
[Bug #1526834] Fix crash in pdb when you do 'b f(';
authorAndrew M. Kuchling <amk@amk.ca>
Tue, 5 Sep 2006 13:19:18 +0000 (13:19 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Tue, 5 Sep 2006 13:19:18 +0000 (13:19 +0000)
the function name was placed into a regex pattern and the unbalanced paren
caused re.compile() to report an error

Lib/pdb.py

index 83884d7987fca74f85be1da9e02af08e35f29af7..dfa6fc8246edb5b422e017f58c4544da75ae4b86 100755 (executable)
@@ -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: