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.
This commit is contained in:
1 parent
0e1c0a5a19
commit
b7f517320f
1 file changed
+1
-1
+1
-1
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user