diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2010-11-29 12:27:45 (GMT) |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2010-11-29 12:27:45 (GMT) |
commit | 5170c81662fbe8b357121c138cd93d9df7941fa2 (patch) | |
tree | 0a1d79337d71eca86ebe5a712448ce3c0e487f6a /Lib/bdb.py | |
parent | a88d2776efac042f6b96d76d7ea3edbd0649c3c6 (diff) | |
download | cpython-5170c81662fbe8b357121c138cd93d9df7941fa2.zip cpython-5170c81662fbe8b357121c138cd93d9df7941fa2.tar.gz cpython-5170c81662fbe8b357121c138cd93d9df7941fa2.tar.bz2 |
Merged revisions 86861 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86861 | senthil.kumaran | 2010-11-29 19:54:17 +0800 (Mon, 29 Nov 2010) | 5 lines
Fix #10561 - Fix pdb behavior. Delete the breakpoints by breakpoint number.
Handle multiple breakpoints at same line. Update docs/test.
Patch by Xavier de Gaye.
........
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -249,6 +249,12 @@ class Bdb: list.append(lineno) bp = Breakpoint(filename, lineno, temporary, cond, funcname) + def _prune_breaks(self, filename, lineno): + if (filename, lineno) not in Breakpoint.bplist: + self.breaks[filename].remove(lineno) + if not self.breaks[filename]: + del self.breaks[filename] + def clear_break(self, filename, lineno): filename = self.canonic(filename) if not filename in self.breaks: @@ -260,10 +266,7 @@ class Bdb: # pair, then remove the breaks entry for bp in Breakpoint.bplist[filename, lineno][:]: bp.deleteMe() - if (filename, lineno) not in Breakpoint.bplist: - self.breaks[filename].remove(lineno) - if not self.breaks[filename]: - del self.breaks[filename] + self._prune_breaks(filename, lineno) def clear_bpbynumber(self, arg): try: @@ -276,7 +279,8 @@ class Bdb: return 'Breakpoint number (%d) out of range' % number if not bp: return 'Breakpoint (%d) already deleted' % number - self.clear_break(bp.file, bp.line) + bp.deleteMe() + self._prune_breaks(bp.file, bp.line) def clear_all_file_breaks(self, filename): filename = self.canonic(filename) |