From d72f6396f06bd90b70acff07dd7416fec113b72d Mon Sep 17 00:00:00 2001 From: BoulderBadgeDad Date: Sun, 28 Jun 2026 00:03:19 -0700 Subject: [PATCH] lint: justify 4 best-effort try/except/pass (S110) so CI ruff passes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the CI ruff gate flagged 4 S110s in code added this cycle: the /api/debug/memory/objects endpoint (len() on an exotic object; optional psutil rss) and the GC sweeper (malloc_trim resolution + the trim call — absent on musl/non-Linux). all are genuinely best-effort, so add '# noqa: S110' with a one-line reason on each. ruff check . is clean. --- web_server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web_server.py b/web_server.py index 7edda4bb..15b5de83 100644 --- a/web_server.py +++ b/web_server.py @@ -3011,14 +3011,14 @@ def debug_memory_objects(): if sz > 1_000_000 and isinstance(o, (dict, list, set, frozenset, bytes, bytearray, str, tuple)): try: biggest.append((sz, tn, len(o))) - except Exception: + except Exception: # noqa: S110 — debug stat, len() on an exotic obj is non-fatal pass biggest.sort(reverse=True) rss = None try: import psutil rss = round(psutil.Process(os.getpid()).memory_info().rss / (1024 * 1024), 1) - except Exception: + except Exception: # noqa: S110 — psutil optional; rss stays None in the debug payload pass return jsonify({ 'rss_mb': rss, @@ -38649,7 +38649,7 @@ def start_runtime_services(): _libc = ctypes.CDLL(ctypes.util.find_library('c') or 'libc.so.6') if hasattr(_libc, 'malloc_trim'): _trim = _libc.malloc_trim - except Exception: + except Exception: # noqa: S110 — malloc_trim absent on musl/non-Linux; just skip it pass floor = rss_mb() last = time.time() @@ -38661,7 +38661,7 @@ def start_runtime_services(): if _trim is not None: try: _trim(0) - except Exception: + except Exception: # noqa: S110 — best-effort OS reclaim, never fatal pass floor = rss_mb() last = time.time()