~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Patch Queue Manager
  • Date: 2012-08-28 21:17:31 UTC
  • mfrom: (6555.1.2 post-mortem)
  • Revision ID: pqm@pqm.ubuntu.com-20120828211731-5di1tveevpzcdtd9
(jelmer) Remove compatibility code for python 2.4 for post mortem. (Jelmer
 Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
935
935
        exitcode = trace.report_exception(exc_info, sys.stderr)
936
936
        if os.environ.get('BZR_PDB'):
937
937
            print '**** entering debugger'
938
 
            tb = exc_info[2]
939
938
            import pdb
940
 
            if sys.version_info[:2] < (2, 6):
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)
 
939
            pdb.post_mortem(exc_info[2])
960
940
        return exitcode
961
941
 
962
942