From 33e2ff586cd0eeb74f359fca5505abd588d44eee Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 5 Jun 2023 13:45:42 -0500 Subject: [PATCH] fix: make check explicitly for nones and not truthy --- src/viv/viv.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index b4704fa..96afccc 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -118,7 +118,7 @@ class Env: ) def __getattr__(self, attr: str) -> Any: - if not attr.startswith("_") and (defined := getattr(self, f"_{attr}")): + if not attr.startswith("_") and (defined:=getattr(self, f"_{attr}")) is not None: return defined else: return os.getenv(attr.upper(), self.defaults.get(attr)) @@ -131,7 +131,6 @@ class Env: def _viv_spec(self) -> List[str]: return [i for i in os.getenv("VIV_SPEC", "").split(" ") if i] - class Cache: def __init__(self) -> None: self.base = Env().viv_cache