mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-12-14 00:24:05 +08:00
Port os.rename calls to work on Windows
os.rename fails on Windows if the destination exists, so replace os.rename to platform_utils.rename which handles the platform differences. Change-Id: I15a86f10f65eedee5b003b80f88a0c28a3e1aa48
This commit is contained in:
committed by
David Pursehouse
parent
a65adf74f9
commit
ad1abcb556
@@ -63,7 +63,7 @@ def _lwrite(path, content):
|
||||
fd.close()
|
||||
|
||||
try:
|
||||
os.rename(lock, path)
|
||||
platform_utils.rename(lock, path)
|
||||
except OSError:
|
||||
os.remove(lock)
|
||||
raise
|
||||
@@ -2198,7 +2198,7 @@ class Project(object):
|
||||
|
||||
if os.path.exists(tmpPath):
|
||||
if curlret == 0 and self._IsValidBundle(tmpPath, quiet):
|
||||
os.rename(tmpPath, dstPath)
|
||||
platform_utils.rename(tmpPath, dstPath)
|
||||
return True
|
||||
else:
|
||||
os.remove(tmpPath)
|
||||
|
||||
Reference in New Issue
Block a user