diff options
author | Georg Brandl <georg@python.org> | 2009-04-01 21:05:44 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-04-01 21:05:44 (GMT) |
commit | 5942b91759de4a541cbde363aeae166c495b1e72 (patch) | |
tree | 37d92d1cdea26cd21f268fc64ab6231a37b9fa96 /Lib/pdb.py | |
parent | 88ed8f2c502a436e4417800be3fafce4c15ba87a (diff) | |
download | cpython-5942b91759de4a541cbde363aeae166c495b1e72.zip cpython-5942b91759de4a541cbde363aeae166c495b1e72.tar.gz cpython-5942b91759de4a541cbde363aeae166c495b1e72.tar.bz2 |
Add NEWS item.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -194,6 +194,9 @@ class Pdb(bdb.Bdb, cmd.Cmd): self.cmdloop() self.forget() + def displayhook(self, item): + print item + def default(self, line): if line[:1] == '!': line = line[1:] locals = self.curframe.f_locals @@ -202,13 +205,16 @@ class Pdb(bdb.Bdb, cmd.Cmd): code = compile(line + '\n', '<stdin>', 'single') save_stdout = sys.stdout save_stdin = sys.stdin + save_displayhook = sys.displayhook try: sys.stdin = self.stdin sys.stdout = self.stdout + sys.displayhook = self.displayhook exec code in globals, locals finally: sys.stdout = save_stdout sys.stdin = save_stdin + sys.displayhook = save_displayhook except: t, v = sys.exc_info()[:2] if type(t) == type(''): |