~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-14 12:03:05 UTC
  • mto: This revision was merged to the branch mainline in revision 5664.
  • Revision ID: andrew.bennetts@canonical.com-20110214120305-7l7iu1h6f13voeo7
Add release note.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
import os
60
60
import sys
61
61
import time
 
62
import tempfile
62
63
 
63
64
from bzrlib.lazy_import import lazy_import
64
65
lazy_import(globals(), """
65
66
from cStringIO import StringIO
66
67
import errno
67
68
import locale
68
 
import tempfile
69
69
import traceback
70
70
""")
71
71
 
81
81
    debug,
82
82
    errors,
83
83
    osutils,
 
84
    plugin,
 
85
    symbol_versioning,
84
86
    ui,
85
87
    )
86
88
""")
486
488
        elif fd is not None:
487
489
            os.close(fd)
488
490
 
489
 
 
490
 
def _qualified_exception_name(eclass, unqualified_bzrlib_errors=False):
491
 
    """Give name of error class including module for non-builtin exceptions
492
 
 
493
 
    If `unqualified_bzrlib_errors` is True, errors specific to bzrlib will
494
 
    also omit the module prefix.
495
 
    """
496
 
    class_name = eclass.__name__
497
 
    module_name = eclass.__module__
498
 
    if module_name in ("exceptions", "__main__") or (
499
 
            unqualified_bzrlib_errors and module_name == "bzrlib.errors"):
500
 
        return class_name
501
 
    return "%s.%s" % (module_name, class_name)
502
 
 
503
 
 
504
491
def report_exception(exc_info, err_file):
505
492
    """Report an exception to err_file (typically stderr) and to .bzr.log.
506
493