Skip to content

Commit

Permalink
use different windows path
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 committed Sep 30, 2023
1 parent fbc3466 commit 01b9a18
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pyconify/_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ def get_cache_directory(app_name: str = "pyconify") -> Path:
if os.name == "posix":
return Path.home() / ".cache" / app_name
elif os.name == "nt":
if local_app_data := os.environ.get("LOCALAPPDATA"):
return Path(local_app_data) / app_name # pragma: no cover
app_data_path = Path("~/AppData/Local").expanduser()
if app_data_path.exists():
return app_data_path / app_name
appdata = os.environ.get("LOCALAPPDATA", "~/AppData/Local")
return Path(appdata).expanduser() / app_name
# Fallback to a directory in the user's home directory
return Path.home() / f".{app_name}" # pragma: no cover

Expand Down

0 comments on commit 01b9a18

Please sign in to comment.