diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index 205746d..0772a8d 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -139,11 +139,9 @@ def wipe(path: Path) -> None: :type path: Path """ try: - shutil.rmtree(path) - except NotADirectoryError: path.unlink(missing_ok=True) - except FileNotFoundError: - pass + except IsADirectoryError: + shutil.rmtree(path) def write(file_path: Path, text: str, charset: str = CHARSET) -> None: