From 2df7ecf4b5a33e23630928567f7a0477237f0ebf Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Sun, 20 Sep 2026 09:55:22 +0100 Subject: [PATCH] Prevent ruff running on a couple of lines where catching and not logging an exception is a deliberate choice. --- core/live_data_cache.py | 2 +- core/single_object_data_cache.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/live_data_cache.py b/core/live_data_cache.py index 34e35d8..7e18186 100644 --- a/core/live_data_cache.py +++ b/core/live_data_cache.py @@ -79,7 +79,7 @@ class LiveDataCache: def _load_snapshot(self): try: data = self._disk_cache.get("snapshot") - except Exception: + except Exception: # noqa: BLE001 (If any exceptions we treat the data as junk and start from scratch, it's probably due to a version upgrade having incompatible data structures, fine to not log the exception in this case) logger.warning(f"Failed to load snapshot from {self._snapshot_dir}, clearing it.") self._disk_cache.clear() return diff --git a/core/single_object_data_cache.py b/core/single_object_data_cache.py index 2bb7fa9..acd880c 100644 --- a/core/single_object_data_cache.py +++ b/core/single_object_data_cache.py @@ -23,7 +23,7 @@ class SingleObjectDataCache: self._cache.add("object", object_if_empty) try: self._obj = self._cache.get("object") - except Exception: + except Exception: # noqa: BLE001 (If any exceptions we treat the data as junk and start from scratch, it's probably due to a version upgrade having incompatible data structures, fine to not log the exception in this case) logger.warning(f"Failed to load cache from {cache_dir}, clearing it.") self._cache.clear() self._cache.add("object", object_if_empty)