diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-03-04 09:56:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-04 09:56:51 +0100 |
| commit | f672d713351ade5dbd8f593bf4b329fb19ad8168 (patch) | |
| tree | ececdabdf59f2263c40ffbd4edb0ff4f4f397b0c /lib/utils/paths.py | |
| parent | bef98ef4ebb5af247f349e32f55a6648bf9dbceb (diff) | |
use get_user_dir (#3549)
Diffstat (limited to 'lib/utils/paths.py')
| -rwxr-xr-x | lib/utils/paths.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/utils/paths.py b/lib/utils/paths.py index 6eafbd77..3bc12c2a 100755 --- a/lib/utils/paths.py +++ b/lib/utils/paths.py @@ -42,7 +42,12 @@ def get_resource_dir(name): def get_user_dir(name=None): - path = platformdirs.user_config_dir("inkstitch") + try: + path = platformdirs.user_config_dir('inkstitch') + except ImportError: + path = os.path.expanduser('~/.inkstitch') + if not os.path.exists(path): + os.makedirs(path) if name is not None: path = os.path.join(path, name) |
