/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

(gz) Allow use of Python arguments preceding bzr script in Windows command
 lines (Jason Spashett)

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
498
498
    elif not getattr(exc_object, 'internal_error', True):
499
499
        report_user_error(exc_info, err_file)
500
500
        return errors.EXIT_ERROR
501
 
    elif isinstance(exc_object, (OSError, IOError)):
 
501
    elif isinstance(exc_object, (OSError, IOError)) or (
 
502
        # GZ 2010-05-20: Like (exc_type is pywintypes.error) but avoid import
 
503
        exc_type.__name__ == "error" and exc_type.__module__ == "pywintypes"):
502
504
        # Might be nice to catch all of these and show them as something more
503
505
        # specific, but there are too many cases at the moment.
504
506
        report_user_error(exc_info, err_file)
538
540
 
539
541
 
540
542
def _flush_stdout_stderr():
541
 
    # installed into an atexit hook by bzrlib.initialize()
 
543
    # called from the bzrlib library finalizer returned by bzrlib.initialize()
542
544
    try:
543
545
        sys.stdout.flush()
544
546
        sys.stderr.flush()
551
553
 
552
554
 
553
555
def _flush_trace():
554
 
    # run from atexit hook
 
556
    # called from the bzrlib library finalizer returned by bzrlib.initialize()
555
557
    global _trace_file
556
558
    if _trace_file:
557
559
        _trace_file.flush()