I use .pdbrc file to help debugging. To avoid editing this file frequently when
source was modified, I need this feature.
I modify the checkline function in pdb.py from
...
line = linecache.getline(filename, lineno, globs)
if not line:
....
to
...
lines = linecache.getlines(filename, globs)
if lineno < 0: lineno = len(lines) + lineno + 1 # change to a valid
positive number, or not
if 1 <= lineno <= len(lines): line = lines[lineno-1]
else: line = ''
if not line:
...
This modification is mostly the copy of the getline function body except the
added line. It will not influence the original pdb usage in anyway.
--Jach
--
https://mail.python.org/mailman/listinfo/python-list