]> granicus.if.org Git - python/commit
Sjoerd Mullender writes:
authorGuido van Rossum <guido@python.org>
Wed, 3 Nov 1999 13:10:07 +0000 (13:10 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 3 Nov 1999 13:10:07 +0000 (13:10 +0000)
commit19878f58fe9e4273458131eec1c18b96da39dcd1
tree6181f68022c8340b7774dc4d53a4e82a11b81768
parentdd7cbbf4d320317065d041a7b407fae840563012
Sjoerd Mullender writes:

I regularly find that pdb sets the breakpoint on the wrong line when I
try to set a breakpoint on a function.  This fixes the problem
somewhat.
The real problem is that pdb tries to parse the Python source code to
find the first executable line.  A better way might be to inspect the
code object, or even have a variable in the code object
co_firstexecutablelineno, but that's too much work.

The patch fixes the problem when the first code line after the def
statement contains the start *and* end of a triple-quoted string.  The
code assumed that the end of a triple-quoted string is not on the same
line as the start, and so it would skip to the end of the *next*
triple-quoted string.
Lib/pdb.py