parent
4bf0e0ea23
commit
f12697c897
@ -58,7 +58,10 @@ def _get_config_dir():
|
|||||||
|
|
||||||
candidate = os.path.abspath(os.path.expanduser(os.environ.get('XDG_CONFIG_HOME') or '~/.config'))
|
candidate = os.path.abspath(os.path.expanduser(os.environ.get('XDG_CONFIG_HOME') or '~/.config'))
|
||||||
ans = os.path.join(candidate, appname)
|
ans = os.path.join(candidate, appname)
|
||||||
os.makedirs(ans, exist_ok=True)
|
try:
|
||||||
|
os.makedirs(ans, exist_ok=True)
|
||||||
|
except FileExistsError:
|
||||||
|
raise SystemExit('A file {} already exists. It must be a directory, not a file.'.format(ans))
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user