Skip to content

Commit b863206

Browse files
committed
Add ~/.config/<AppName> as user_config_dir fallback on MacOS X
1 parent f8a8e9d commit b863206

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

appdirs.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
185185
for a discussion of issues.
186186
187187
Typical user config directories are:
188-
Mac OS X: ~/Library/Preferences/<AppName>
188+
Mac OS X: ~/Library/Preferences/<AppName> if it exists, else ~/.config/<AppName>
189189
Unix: ~/.config/<AppName> # or in $XDG_CONFIG_HOME, if defined
190190
Win *: same as user_data_dir
191191
@@ -198,6 +198,10 @@ def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
198198
path = os.path.expanduser('~/Library/Preferences/')
199199
if appname:
200200
path = os.path.join(path, appname)
201+
if not os.path.isdir(path):
202+
path = os.path.expanduser('~/.config/')
203+
if appname:
204+
path = os.path.join(path, appname)
201205
else:
202206
path = os.getenv('XDG_CONFIG_HOME', os.path.expanduser("~/.config"))
203207
if appname:

0 commit comments

Comments
 (0)