Be better at removing dead links
This commit is contained in:
parent
3a8677c630
commit
1df60b873b
2 changed files with 8 additions and 2 deletions
projects/vfs/src/python/vfs
|
@ -51,10 +51,14 @@ class Vfs(object):
|
|||
|
||||
elif e[0] == "unlink":
|
||||
_, dest = e
|
||||
if dest.is_dir():
|
||||
if dest.is_symlink():
|
||||
dest.unlink()
|
||||
elif dest.is_dir():
|
||||
rmtree(dest)
|
||||
elif dest.is_file():
|
||||
dest.unlink()
|
||||
else:
|
||||
raise Exception(f"Couldn't unlink {dest}")
|
||||
|
||||
def _append(self, msg):
|
||||
self._log.append(msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue