Merge lp:~jelmer/bzr/rm-post-mortem-compat into lp:bzr

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merged at revision: 6556
Proposed branch: lp:~jelmer/bzr/rm-post-mortem-compat
Merge into: lp:bzr
Diff against target: 31 lines (+1/-21)
1 file modified
bzrlib/commands.py (+1/-21)
To merge this branch: bzr merge lp:~jelmer/bzr/rm-post-mortem-compat
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Review via email: mp+121342@code.launchpad.net

Commit message

Remove compatibility code for python 2.4 for post mortem.

Description of the change

Remove post-mortem compatibility code for bzr < 2.6.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Suggest you also avoid binding the tb in the local frame:

             tb = exc_info[2]

And just pass it directly or post_mortem pick it out itself.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/commands.py'
--- bzrlib/commands.py 2012-03-13 17:25:29 +0000
+++ bzrlib/commands.py 2012-08-28 20:52:20 +0000
@@ -935,28 +935,8 @@
935 exitcode = trace.report_exception(exc_info, sys.stderr)935 exitcode = trace.report_exception(exc_info, sys.stderr)
936 if os.environ.get('BZR_PDB'):936 if os.environ.get('BZR_PDB'):
937 print '**** entering debugger'937 print '**** entering debugger'
938 tb = exc_info[2]
939 import pdb938 import pdb
940 if sys.version_info[:2] < (2, 6):939 pdb.post_mortem(exc_info[2])
941 # XXX: we want to do
942 # pdb.post_mortem(tb)
943 # but because pdb.post_mortem gives bad results for tracebacks
944 # from inside generators, we do it manually.
945 # (http://bugs.python.org/issue4150, fixed in Python 2.6)
946
947 # Setup pdb on the traceback
948 p = pdb.Pdb()
949 p.reset()
950 p.setup(tb.tb_frame, tb)
951 # Point the debugger at the deepest frame of the stack
952 p.curindex = len(p.stack) - 1
953 p.curframe = p.stack[p.curindex][0]
954 # Start the pdb prompt.
955 p.print_stack_entry(p.stack[p.curindex])
956 p.execRcLines()
957 p.cmdloop()
958 else:
959 pdb.post_mortem(tb)
960 return exitcode940 return exitcode
961941
962942