From 0a9404fb2f6a908e9469179433e78eb2ec9c3e61 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 13 Sep 2024 17:19:33 +0200 Subject: [PATCH] fs/unlink --- rwx/fs/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index 514fcec..a7cc5b0 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -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