~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

Merge cleanup into first-try

Show diffs side-by-side

added added

removed removed

Lines of Context:
374
374
    _trace_file = old_trace_file
375
375
    bzr_logger = logging.getLogger('bzr')
376
376
    bzr_logger.removeHandler(new_handler)
377
 
    # must be closed, otherwise logging will try to close it atexit, and the
 
377
    # must be closed, otherwise logging will try to close it at exit, and the
378
378
    # file will likely already be closed underneath.
379
379
    new_handler.close()
380
380
    bzr_logger.handlers = old_handlers
540
540
 
541
541
 
542
542
def _flush_stdout_stderr():
543
 
    # installed into an atexit hook by bzrlib.initialize()
 
543
    # called from the bzrlib library finalizer returned by bzrlib.initialize()
544
544
    try:
545
545
        sys.stdout.flush()
546
546
        sys.stderr.flush()
553
553
 
554
554
 
555
555
def _flush_trace():
556
 
    # run from atexit hook
 
556
    # called from the bzrlib library finalizer returned by bzrlib.initialize()
557
557
    global _trace_file
558
558
    if _trace_file:
559
559
        _trace_file.flush()