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
1=== modified file 'bzrlib/commands.py'
2--- bzrlib/commands.py 2012-03-13 17:25:29 +0000
3+++ bzrlib/commands.py 2012-08-28 20:52:20 +0000
4@@ -935,28 +935,8 @@
5 exitcode = trace.report_exception(exc_info, sys.stderr)
6 if os.environ.get('BZR_PDB'):
7 print '**** entering debugger'
8- tb = exc_info[2]
9 import pdb
10- if sys.version_info[:2] < (2, 6):
11- # XXX: we want to do
12- # pdb.post_mortem(tb)
13- # but because pdb.post_mortem gives bad results for tracebacks
14- # from inside generators, we do it manually.
15- # (http://bugs.python.org/issue4150, fixed in Python 2.6)
16-
17- # Setup pdb on the traceback
18- p = pdb.Pdb()
19- p.reset()
20- p.setup(tb.tb_frame, tb)
21- # Point the debugger at the deepest frame of the stack
22- p.curindex = len(p.stack) - 1
23- p.curframe = p.stack[p.curindex][0]
24- # Start the pdb prompt.
25- p.print_stack_entry(p.stack[p.curindex])
26- p.execRcLines()
27- p.cmdloop()
28- else:
29- pdb.post_mortem(tb)
30+ pdb.post_mortem(exc_info[2])
31 return exitcode
32
33