summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2008-01-15 21:44:53 (GMT)
committerGuido van Rossum <guido@python.org>2008-01-15 21:44:53 (GMT)
commit7736b5becd273cb271c55fcce9155677a381c4f6 (patch)
tree2c18c15c4ee0475ab6b1394a2e5cb18358ddbbbc /Lib/pdb.py
parentae138cbfbbfb376917fd29abb6724d56ba5fc081 (diff)
downloadcpython-7736b5becd273cb271c55fcce9155677a381c4f6.zip
cpython-7736b5becd273cb271c55fcce9155677a381c4f6.tar.gz
cpython-7736b5becd273cb271c55fcce9155677a381c4f6.tar.bz2
Merged revisions 59952-59984 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r59952 | thomas.heller | 2008-01-14 02:35:28 -0800 (Mon, 14 Jan 2008) | 1 line Issue 1821: configure libffi for amd64 on FreeeBSD. ........ r59953 | andrew.kuchling | 2008-01-14 06:48:43 -0800 (Mon, 14 Jan 2008) | 1 line Update description of float_info ........ r59959 | raymond.hettinger | 2008-01-14 14:58:05 -0800 (Mon, 14 Jan 2008) | 1 line Fix 1698398: Zipfile.printdir() crashed because the format string expected a tuple object of length six instead of a time.struct_time object. ........ r59961 | andrew.kuchling | 2008-01-14 17:29:16 -0800 (Mon, 14 Jan 2008) | 1 line Typo fixes ........ r59962 | andrew.kuchling | 2008-01-14 17:29:44 -0800 (Mon, 14 Jan 2008) | 1 line Markup fix ........ r59963 | andrew.kuchling | 2008-01-14 17:47:32 -0800 (Mon, 14 Jan 2008) | 1 line Add many items ........ r59964 | andrew.kuchling | 2008-01-14 17:55:32 -0800 (Mon, 14 Jan 2008) | 1 line Repair unfinished sentence ........ r59967 | raymond.hettinger | 2008-01-14 19:02:37 -0800 (Mon, 14 Jan 2008) | 5 lines Issue 1820: structseq objects did not work with the % formatting operator or isinstance(t, tuple). Orignal patch (without tests) by Leif Walsh. ........ r59968 | raymond.hettinger | 2008-01-14 19:07:42 -0800 (Mon, 14 Jan 2008) | 1 line Tighten the definition of a named tuple. ........ r59969 | skip.montanaro | 2008-01-14 19:40:20 -0800 (Mon, 14 Jan 2008) | 3 lines Better (?) text describing the lack of guarantees provided by qsize(), empty() and full(). ........ r59970 | raymond.hettinger | 2008-01-14 21:39:59 -0800 (Mon, 14 Jan 2008) | 1 line Temporarily revert 59967 until GC can be added. ........ r59971 | raymond.hettinger | 2008-01-14 21:46:43 -0800 (Mon, 14 Jan 2008) | 1 line Small grammar nit ........ r59972 | georg.brandl | 2008-01-14 22:55:56 -0800 (Mon, 14 Jan 2008) | 2 lines Typo. ........ r59973 | georg.brandl | 2008-01-14 22:58:15 -0800 (Mon, 14 Jan 2008) | 2 lines Remove duplicate entry. ........ r59974 | jeffrey.yasskin | 2008-01-14 23:46:24 -0800 (Mon, 14 Jan 2008) | 12 lines Add rational.Rational as an implementation of numbers.Rational with infinite precision. This has been discussed at http://bugs.python.org/issue1682. It's useful primarily for teaching, but it also demonstrates how to implement a member of the numeric tower, including fallbacks for mixed-mode arithmetic. I expect to write a couple more patches in this area: * Rational.from_decimal() * Rational.trim/approximate() (maybe with different names) * Maybe remove the parentheses from Rational.__str__() * Maybe rename one of the Rational classes * Maybe make Rational('3/2') work. ........ r59978 | andrew.kuchling | 2008-01-15 06:38:05 -0800 (Tue, 15 Jan 2008) | 8 lines Restore description of sys.dont_write_bytecode. The duplication is intentional -- this paragraph is in a section describing additions to the sys module, and there's a later section that mentions the switch. I think most people scan the what's-new and don't read it in detail, so a bit of duplication is OK. ........ r59984 | guido.van.rossum | 2008-01-15 09:59:29 -0800 (Tue, 15 Jan 2008) | 3 lines Issue #1786 (by myself): pdb should use its own stdin/stdout around an exec call and when creating a recursive instance. ........
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index bd51c31..dfd745d 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -198,7 +198,13 @@ class Pdb(bdb.Bdb, cmd.Cmd):
globals = self.curframe.f_globals
try:
code = compile(line + '\n', '<stdin>', 'single')
- exec(code, globals, locals)
+ try:
+ sys.stdin = self.stdin
+ sys.stdout = self.stdout
+ exec(code, globals, locals)
+ finally:
+ sys.stdout = save_stdout
+ sys.stdin = save_stdin
except:
t, v = sys.exc_info()[:2]
if type(t) == type(''):
@@ -656,7 +662,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
sys.settrace(None)
globals = self.curframe.f_globals
locals = self.curframe.f_locals
- p = Pdb()
+ p = Pdb(self.completekey, self.stdin, self.stdout)
p.prompt = "(%s) " % self.prompt.strip()
print("ENTERING RECURSIVE DEBUGGER", file=self.stdout)
sys.call_tracing(p.run, (arg, globals, locals))