diff options
author | Georg Brandl <georg@python.org> | 2009-09-16 16:36:39 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-09-16 16:36:39 +0000 |
commit | de8bbf972708a3d615d4e2215dece94795385d8e (patch) | |
tree | e87c9350d3097cf86b3db1c0be69eaa1568a21c3 /Lib/pdb.py | |
parent | 7180621893f386d097e9f1ca3250c82af6a65f6d (diff) | |
download | cpython-de8bbf972708a3d615d4e2215dece94795385d8e.tar.gz |
Make the pdb displayhook compatible with the standard displayhook: do not print Nones. Add a test for that.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py index eae62960ce..0751c17667 100755 --- a/Lib/pdb.py +++ b/Lib/pdb.py @@ -210,7 +210,9 @@ class Pdb(bdb.Bdb, cmd.Cmd): """Custom displayhook for the exec in default(), which prevents assignment of the _ variable in the builtins. """ - print repr(obj) + # reproduce the behavior of the standard displayhook, not printing None + if obj is not None: + print repr(obj) def default(self, line): if line[:1] == '!': line = line[1:] |