use os.replace not os.rename

This commit is contained in:
Thomas Waldmann 2023-01-13 19:17:48 +01:00
parent 163e92dd04
commit e1bb669400
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 1 additions and 1 deletions

View File

@ -141,7 +141,7 @@ class ExclusiveLock:
timer = TimeoutTimer(timeout, sleep).start()
while True:
try:
os.rename(temp_path, self.path)
os.replace(temp_path, self.path)
except OSError: # already locked
if self.by_me():
return self