diff options
author | Facundo Batista <facundobatista@gmail.com> | 2008-03-08 16:50:27 (GMT) |
---|---|---|
committer | Facundo Batista <facundobatista@gmail.com> | 2008-03-08 16:50:27 (GMT) |
commit | c54aec1fda52a0f21bdd8c529c9bb9c92b24f96a (patch) | |
tree | f76f155650aaf4b7cf1a00007b865dc0f699cb15 /Lib/pdb.py | |
parent | 372d55e3e6fb163f7561403b312d9104a7f9238a (diff) | |
download | cpython-c54aec1fda52a0f21bdd8c529c9bb9c92b24f96a.zip cpython-c54aec1fda52a0f21bdd8c529c9bb9c92b24f96a.tar.gz cpython-c54aec1fda52a0f21bdd8c529c9bb9c92b24f96a.tar.bz2 |
Issue 1106316. post_mortem()'s parameter, traceback, is now
optional: it defaults to the traceback of the exception that is currently
being handled.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1198,7 +1198,16 @@ def set_trace(): # Post-Mortem interface -def post_mortem(t): +def post_mortem(t=None): + # handling the default + if t is None: + # sys.exc_info() returns (type, value, traceback) if an exception is + # being handled, otherwise it returns None + t = sys.exc_info()[2] + if t is None: + raise ValueError("A valid traceback must be passed if no " + "exception is being handled") + p = Pdb() p.reset() while t.tb_next is not None: |