separate handling of single files
This commit is contained in:
parent
c92c93458c
commit
620945da3c
1 changed files with 5 additions and 3 deletions
|
@ -161,8 +161,10 @@ def secure_delete(path: str):
|
|||
for name in files:
|
||||
p = Path(os.path.join(root, name))
|
||||
p.chmod(stat.S_IWRITE)
|
||||
|
||||
if os.path.isdir(name):
|
||||
shutil.rmtree(name)
|
||||
else:
|
||||
os.unlink(name)
|
||||
|
||||
shutil.rmtree(path, onerror=del_rw)
|
||||
|
||||
|
|
Loading…
Reference in a new issue