~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/crash.py

  • Committer: Martin Pool
  • Date: 2010-02-02 16:39:23 UTC
  • mto: (4999.3.1 apport)
  • mto: This revision was merged to the branch mainline in revision 5002.
  • Revision ID: mbp@sourcefrog.net-20100202163923-iikrxieqajso6vxb
Add APPORT_DISABLE to turn it off

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
 
60
60
def report_bug(exc_info, stderr):
61
 
    if 'no_apport' not in debug.debug_flags:
62
 
        try:
63
 
            report_bug_to_apport(exc_info, stderr)
64
 
            return
65
 
        except ImportError, e:
66
 
            trace.mutter("couldn't find apport bug-reporting library: %s" % e)
67
 
            pass
68
 
        except Exception, e:
69
 
            # this should only happen if apport is installed but it didn't
70
 
            # work, eg because of an io error writing the crash file
71
 
            sys.stderr.write("bzr: failed to report crash using apport:\n "
72
 
                "    %r\n" % e)
73
 
            pass
74
 
    report_bug_legacy(exc_info, stderr)
 
61
    if ('no_apport' in debug.debug_flags) or (
 
62
        'APPORT_DISABLE' in os.environ):
 
63
        return report_bug_legacy(exc_info, stderr)
 
64
    try:
 
65
        report_bug_to_apport(exc_info, stderr)
 
66
        return
 
67
    except ImportError, e:
 
68
        trace.mutter("couldn't find apport bug-reporting library: %s" % e)
 
69
        pass
 
70
    except Exception, e:
 
71
        # this should only happen if apport is installed but it didn't
 
72
        # work, eg because of an io error writing the crash file
 
73
        stderr.write("bzr: failed to report crash using apport:\n "
 
74
            "    %r\n" % e)
 
75
        pass
 
76
    return report_bug_legacy(exc_info, stderr)
75
77
 
76
78
 
77
79
def report_bug_legacy(exc_info, err_file):