Commit 19564800 authored by Georg Brandl's avatar Georg Brandl

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.
parent 38c6a22f
......@@ -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----------
......
......@@ -352,7 +352,7 @@ class _OutputRedirectingPdb(pdb.Pdb):
"""
def __init__(self, out):
self.__out = out
pdb.Pdb.__init__(self)
pdb.Pdb.__init__(self, stdout=out)
def trace_dispatch(self, *args):
# Redirect stdout to the given stream.
......
This diff is collapsed.
......@@ -96,6 +96,10 @@ Extension Modules
Library
-------
- 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.
- Patch #1484695: Update the tarfile module to version 0.8. This fixes
a couple of issues, notably handling of long file names using the
GNU LONGNAME extension.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment