fix: name a missing database in one error line

This commit is contained in:
Abdessamad Derraz committed 2026-10-18 08:34:09 +02:00
1 parent 9579f6c449
commit 4240c98359
7 files changed
+78 -16

No files matched your search

+8 -6
View File
@@ -326,13 +326,15 @@ def _files_to_validate(
def _load_database_if_any(path: str) -> dict | None:
try:
return load_database(path)
except FileNotFoundError:
return None
except json.JSONDecodeError as e:
print(f"WARNING: corrupt database.json: {e}", file=sys.stderr)
"""The database, optional only where the default is meant.
A mistyped --db read as "no database" and every file passed its
duplicate and placement checks unchecked; a damaged one did the same
after a warning.
"""
if path == DEFAULT_DB and not os.path.exists(path):
return None
return load_database(path)
def main() -> None: