mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 02:30:44 -06:00
fix: make check explicitly for nones and not truthy
This commit is contained in:
parent
9b533c9c32
commit
33e2ff586c
1 changed files with 1 additions and 2 deletions
|
@ -118,7 +118,7 @@ class Env:
|
||||||
)
|
)
|
||||||
|
|
||||||
def __getattr__(self, attr: str) -> Any:
|
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
|
return defined
|
||||||
else:
|
else:
|
||||||
return os.getenv(attr.upper(), self.defaults.get(attr))
|
return os.getenv(attr.upper(), self.defaults.get(attr))
|
||||||
|
@ -131,7 +131,6 @@ class Env:
|
||||||
def _viv_spec(self) -> List[str]:
|
def _viv_spec(self) -> List[str]:
|
||||||
return [i for i in os.getenv("VIV_SPEC", "").split(" ") if i]
|
return [i for i in os.getenv("VIV_SPEC", "").split(" ") if i]
|
||||||
|
|
||||||
|
|
||||||
class Cache:
|
class Cache:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
self.base = Env().viv_cache
|
self.base = Env().viv_cache
|
||||||
|
|
Loading…
Reference in a new issue