The debugging.py calls post_mortem() on error and pdb will drops an interactive debugger when the stdin is a readable fd.