~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Martin Pool
  • Date: 2007-10-02 02:54:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2873.
  • Revision ID: mbp@sourcefrog.net-20071002025430-5qkc146iuaqxdsgk
Ignore .pyd files in bzr tree (windows C extensions)

Show diffs side-by-side

added added

removed removed

Lines of Context:
803
803
    except (KeyboardInterrupt, Exception), e:
804
804
        # used to handle AssertionError and KeyboardInterrupt
805
805
        # specially here, but hopefully they're handled ok by the logger now
806
 
        exitcode = trace.report_exception(sys.exc_info(), sys.stderr)
 
806
        trace.report_exception(sys.exc_info(), sys.stderr)
807
807
        if os.environ.get('BZR_PDB'):
808
808
            print '**** entering debugger'
809
809
            import pdb
810
810
            pdb.post_mortem(sys.exc_traceback)
811
 
        return exitcode
812
 
 
813
 
 
814
 
def run_bzr_catch_user_errors(argv):
815
 
    """Run bzr and report user errors, but let internal errors propagate.
816
 
 
817
 
    This is used for the test suite, and might be useful for other programs
818
 
    that want to wrap the commandline interface.
819
 
    """
820
 
    try:
821
 
        return run_bzr(argv)
822
 
    except Exception, e:
823
 
        if (isinstance(e, (OSError, IOError))
824
 
            or not getattr(e, 'internal_error', True)):
825
 
            trace.report_exception(sys.exc_info(), sys.stderr)
826
 
            return 3
827
 
        else:
828
 
            raise
 
811
        return 3
829
812
 
830
813
 
831
814
class HelpCommandIndex(object):