~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Martin Pool
  • Date: 2005-07-11 07:33:45 UTC
  • Revision ID: mbp@sourcefrog.net-20050711073345-177b10e674961bda
- merge John's code to give the tree root an explicit file id

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
    finally:
99
99
        outf.close()
100
100
 
 
101
def rename(path_from, path_to):
 
102
    """Basically the same as os.rename() just special for win32"""
 
103
    if sys.platform == 'win32':
 
104
        try:
 
105
            os.remove(path_to)
 
106
        except OSError, e:
 
107
            if e.errno != e.ENOENT:
 
108
                raise
 
109
    os.rename(path_from, path_to)
 
110
 
 
111
 
101
112
 
102
113
 
103
114