fix: make check explicitly for nones and not truthy

This commit is contained in:
Daylin Morgan 2023-06-05 13:45:42 -05:00
parent 9b533c9c32
commit 33e2ff586c
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -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