Fix 34616

Updated pdb.py and test_pdb.py to match the code in the CPython patch.

See http://hg.python.org/cpython/rev/f7dd5178f36a for the patch.