diff --git a/projects/vfs/src/python/vfs/impl.py b/projects/vfs/src/python/vfs/impl.py index 2ac3fe7..68cf3e9 100644 --- a/projects/vfs/src/python/vfs/impl.py +++ b/projects/vfs/src/python/vfs/impl.py @@ -51,12 +51,16 @@ class Vfs(object): elif e[0] == "unlink": _, dest = e - if dest.is_symlink(): + # Note that a path which is a dangling symlink will NOT exist but WILL be a symlink + if not dest.exists() and not dest.is_symlink(): + return + # Files and dirs just unlink + if dest.is_symlink() or dest.is_file(): dest.unlink() + # Dirs require recursion elif dest.is_dir(): rmtree(dest) - elif dest.is_file(): - dest.unlink() + # Don't succeed silently else: raise Exception(f"Couldn't unlink {dest}")