Fix 34616

Updated pdb.py and test_pdb.py to match the code in the CPython patch.