diff options
author | Georg Brandl <georg@python.org> | 2006-05-10 17:13:20 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-10 17:13:20 (GMT) |
commit | 195648000cd704e9d50dee0e7f082f3eb74d3bd3 (patch) | |
tree | f973294083136b57fee18c3a441ab296774e05a7 /Lib/bdb.py | |
parent | 38c6a22f38a249d107691a79f2b16a62ba8c73be (diff) | |
download | cpython-195648000cd704e9d50dee0e7f082f3eb74d3bd3.zip cpython-195648000cd704e9d50dee0e7f082f3eb74d3bd3.tar.gz cpython-195648000cd704e9d50dee0e7f082f3eb74d3bd3.tar.bz2 |
Patch #721464: pdb.Pdb instances can now be given explicit stdin and
stdout arguments, making it possible to redirect input and output
for remote debugging.
Diffstat (limited to 'Lib/bdb.py')
-rw-r--r-- | Lib/bdb.py | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -473,7 +473,9 @@ class Breakpoint: def disable(self): self.enabled = 0 - def bpprint(self): + def bpprint(self, out=None): + if out is None: + out = sys.stdout if self.temporary: disp = 'del ' else: @@ -482,17 +484,17 @@ class Breakpoint: disp = disp + 'yes ' else: disp = disp + 'no ' - print '%-4dbreakpoint %s at %s:%d' % (self.number, disp, - self.file, self.line) + print >>out, '%-4dbreakpoint %s at %s:%d' % (self.number, disp, + self.file, self.line) if self.cond: - print '\tstop only if %s' % (self.cond,) + print >>out, '\tstop only if %s' % (self.cond,) if self.ignore: - print '\tignore next %d hits' % (self.ignore) + print >>out, '\tignore next %d hits' % (self.ignore) if (self.hits): if (self.hits > 1): ss = 's' else: ss = '' - print ('\tbreakpoint already hit %d time%s' % - (self.hits, ss)) + print >>out, ('\tbreakpoint already hit %d time%s' % + (self.hits, ss)) # -----------end of Breakpoint class---------- |