~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: Martin Pool
  • Date: 2005-09-22 12:12:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050922121253-eae2a3240ea5e493
- upgrade can no longer be done in current version branches
  so don't test it

Show diffs side-by-side

added added

removed removed

Lines of Context:
104
104
            return
105
105
        old_fname = trace_fname + '.old'
106
106
 
107
 
        from osutils import rename
108
 
        rename(trace_fname, old_fname)
 
107
        try:
 
108
            # must remove before rename on windows
 
109
            os.remove(old_fname)
 
110
        except OSError:
 
111
            pass
109
112
 
 
113
        try:
 
114
            # might fail if in use on windows
 
115
            os.rename(trace_fname, old_fname)
 
116
        except OSError:
 
117
            pass
110
118
    except OSError:
111
119
        return
112
120
 
192
200
    logging.getLogger('').addHandler(_stderr_handler)
193
201
 
194
202
 
 
203
 
195
204
def disable_default_logging():
196
205
    """Turn off default log handlers.
197
206