Make the pdb displayhook compatible with the standard displayhook: do not print Nones. Add a test for that.
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 @@
"""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:]