checking existence before setting flags
This commit is contained in:
parent
7521aeeda1
commit
66444f4952
1 changed files with 2 additions and 0 deletions
|
@ -153,6 +153,8 @@ def secure_delete(path: str):
|
|||
return
|
||||
|
||||
def del_rw(action, name, exc):
|
||||
if not os.path.exists(name):
|
||||
return
|
||||
os.chmod(name, stat.S_IWRITE)
|
||||
os.remove(name)
|
||||
|
||||
|
|
Loading…
Reference in a new issue