From b7f517320fa02d1cd63cccdc8bc3771cbfbc2d5e Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Tue, 22 Sep 2026 13:34:22 +0530 Subject: [PATCH] refactor(constants): match sibling home-resolution null-check idiom get_managed_system used 'if home' (truthiness); the sibling resolvers in the same file (hermes_home_key:134, get_scratch_dir:1167) use 'if home is not None'. On the production call path base is always a Path so behaviour is identical, but the drift is a footgun for any future direct get_managed_system('') caller. Align to the sibling idiom. --- hermes_constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_constants.py b/hermes_constants.py index 1dd846884d..d5d4d25644 100644 --- a/hermes_constants.py +++ b/hermes_constants.py @@ -1061,7 +1061,7 @@ def get_managed_system(home: str | Path | None = None) -> str | None: (:func:`apply_secure_dir_policy` at boot, before ``--profile`` re-homes the process). Defaults to the effective home.""" marker = os.getenv("HERMES_MANAGED", "").strip().lower() or None - managed_marker = (Path(home) if home else get_hermes_home()) / ".managed" + managed_marker = (Path(home) if home is not None else get_hermes_home()) / ".managed" if marker is None and managed_marker.exists(): try: marker = managed_marker.read_text(encoding="utf-8", errors="replace").strip().lower()