summaryrefslogtreecommitdiff
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-16 16:36:39 +0000
committerGeorg Brandl <georg@python.org>2009-09-16 16:36:39 +0000
commitde8bbf972708a3d615d4e2215dece94795385d8e (patch)
treee87c9350d3097cf86b3db1c0be69eaa1568a21c3 /Lib/pdb.py
parent7180621893f386d097e9f1ca3250c82af6a65f6d (diff)
downloadcpython-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-xLib/pdb.py4
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:]