enable bug-bear linting rules

This commit is contained in:
Jörg Thalheim
2024-09-02 13:26:07 +02:00
parent b313f2d066
commit 109d1faf9e
33 changed files with 214 additions and 104 deletions

View File

@@ -38,8 +38,8 @@ def remove_object(path: Path, name: str) -> list[Path]:
try:
shutil.rmtree(path / name)
paths_to_commit.append(path / name)
except FileNotFoundError:
raise ClanError(f"{name} not found in {path}")
except FileNotFoundError as e:
raise ClanError(f"{name} not found in {path}") from e
if not os.listdir(path):
os.rmdir(path)
return paths_to_commit