fs/unlink

This commit is contained in:
Marc Beninca 2024-09-13 17:19:33 +02:00
parent 3393f09907
commit 0a9404fb2f
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -2,6 +2,7 @@
import os
import shutil
from pathlib import Path
from rwx import ps
@ -69,7 +70,7 @@ def wipe(path: str) -> None:
try:
shutil.rmtree(path)
except NotADirectoryError:
os.remove(path)
Path(path).unlink(missing_ok=True)
except FileNotFoundError:
pass