Unlink before rename (for NT).

This commit is contained in:
Guido van Rossum 1997-05-19 15:20:49 +00:00
parent 1aa7e3a177
commit 650b3aad55
1 changed files with 5 additions and 1 deletions

View File

@ -198,7 +198,11 @@ def mirrorsubdir(f, localdir):
if fp1 != fp:
fp1.close()
try:
os.rename(tempname, fullname)
os.unlink(fullname)
except os.error:
pass # Ignore the error
try:
os.rename(tempname, fullname)
except os.error, msg:
print "Can't rename %s to %s: %s" % (tempname,
fullname,