From b8ae0df0aeb22abaf961c54379f502bcf849c4a2 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sat, 5 Aug 2023 14:41:34 +0200 Subject: [PATCH] Use get() instead of in for os.environ to also skip if the value is empty. --- SConscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SConscript b/SConscript index 8f899ba..ebb60b3 100644 --- a/SConscript +++ b/SConscript @@ -68,9 +68,9 @@ def _wrap_default(default): def _find_system_cache_dir() -> str: if os.name == 'posix': - if 'XDG_CACHE_HOME' in os.environ: + if os.environ.get('XDG_CACHE_HOME'): return os.environ['XDG_CACHE_HOME'] - elif 'HOME' in os.environ: + elif os.environ.get('HOME'): return os.path.join(os.environ['HOME'], '.cache') elif os.name == 'nt': # TODO: just guessing