|
|
@ -92,13 +92,13 @@ if os.name == 'nt': # pragma: no cover
|
|
|
|
return
|
|
|
|
return
|
|
|
|
# Fall back to "move away and replace"
|
|
|
|
# Fall back to "move away and replace"
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
os.rename(src, dst)
|
|
|
|
shutil.move(src, dst)
|
|
|
|
except OSError as e:
|
|
|
|
except OSError as e:
|
|
|
|
if e.errno != errno.EEXIST:
|
|
|
|
if e.errno != errno.EEXIST:
|
|
|
|
raise
|
|
|
|
raise
|
|
|
|
old = "%s-%08x" % (dst, random.randint(0, sys.maxint))
|
|
|
|
old = "%s-%08x" % (dst, random.randint(0, sys.maxint))
|
|
|
|
os.rename(dst, old)
|
|
|
|
shutil.move(dst, old)
|
|
|
|
os.rename(src, dst)
|
|
|
|
shutil.move(src, dst)
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
os.unlink(old)
|
|
|
|
os.unlink(old)
|
|
|
|
except Exception:
|
|
|
|
except Exception:
|
|
|
|