use os.path.expanduser to get home dir on Unix

It works even if HOME is not set.
This commit is contained in:
Boris Nagaev 2016-07-28 11:46:58 +03:00
parent 6e7854fd05
commit c0ae601f3c

View File

@ -215,9 +215,9 @@ def get_default_cache():
return os.path.join(cache_root, "HereRocks", "Cache") return os.path.join(cache_root, "HereRocks", "Cache")
else: else:
home = os.getenv("HOME") home = os.path.expanduser("~")
if home is None: if home == "~":
return None return None
else: else:
return os.path.join(home, ".cache", "hererocks") return os.path.join(home, ".cache", "hererocks")