diff --git a/karaokatalog/deduplicate/instructions/DeleteInstruction.py b/karaokatalog/deduplicate/instructions/DeleteInstruction.py index 682158b..ac1e4d0 100644 --- a/karaokatalog/deduplicate/instructions/DeleteInstruction.py +++ b/karaokatalog/deduplicate/instructions/DeleteInstruction.py @@ -13,4 +13,7 @@ class DeleteInstruction(Instruction): path_to_delete: Path def __call__(self) -> None: - self.path_to_delete.unlink() + try: + self.path_to_delete.unlink() + except IsADirectoryError: + self.path_to_delete.rmdir()