Use rmdir if necessary
This commit is contained in:
parent
ddc1448acc
commit
da023a5ae2
@ -13,4 +13,7 @@ class DeleteInstruction(Instruction):
|
|||||||
path_to_delete: Path
|
path_to_delete: Path
|
||||||
|
|
||||||
def __call__(self) -> None:
|
def __call__(self) -> None:
|
||||||
self.path_to_delete.unlink()
|
try:
|
||||||
|
self.path_to_delete.unlink()
|
||||||
|
except IsADirectoryError:
|
||||||
|
self.path_to_delete.rmdir()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user