Use fallback if HOME is not set.

This commit is contained in:
Patrick 2023-08-05 14:38:19 +02:00
parent 3e370bfa52
commit 2f3705bb12

View File

@ -70,13 +70,13 @@ def _find_system_cache_dir() -> str:
if os.name == 'posix':
if 'XDG_CACHE_HOME' in os.environ:
return os.environ['XDG_CACHE_HOME']
else:
elif 'HOME' in os.environ:
return os.path.join(os.environ['HOME'], '.cache')
elif os.name == 'nt':
# TODO: just guessing
return os.environ['LocalAppData']
else: # fallback
return Dir('#cache').abspath
# fallback
return Dir('#cache').abspath
Import('config')