Fix atomicWrite non existing tmpold removal
This commit is contained in:
parent
9546ed0bb6
commit
f8f857c820
1 changed files with 2 additions and 1 deletions
|
@ -23,6 +23,7 @@ def atomicWrite(dest, content, mode="wb"):
|
|||
if os.path.isfile(dest): # Rename old file to -tmpold
|
||||
os.rename(dest, dest + "-tmpold")
|
||||
os.rename(dest + "-tmpnew", dest)
|
||||
if os.path.isfile(dest + "-tmpold"):
|
||||
os.unlink(dest + "-tmpold") # Remove old file
|
||||
return True
|
||||
except Exception as err:
|
||||
|
|
Loading…
Reference in a new issue