summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-09-16 16:36:39 (GMT)
committerGeorg Brandl <georg@python.org>2009-09-16 16:36:39 (GMT)
commit69dfe8d80ed77215b4bfe84138ef070d6c0c7b16 (patch)
tree34ac19b65de337bcf67a3cdeb7615fe7e8da437c /Lib/pdb.py
parent6c39f06ab2a85ba21b87f156ad3e3010feed7bda (diff)
downloadcpython-69dfe8d80ed77215b4bfe84138ef070d6c0c7b16.zip
cpython-69dfe8d80ed77215b4bfe84138ef070d6c0c7b16.tar.gz
cpython-69dfe8d80ed77215b4bfe84138ef070d6c0c7b16.tar.bz2
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 eae6296..0751c17 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:]