mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 18:22:09 +02:00
Another place we can use exist_ok
This commit is contained in:
@@ -32,10 +32,7 @@ def _get_config_dir():
|
|||||||
|
|
||||||
candidate = os.path.abspath(os.path.expanduser(os.environ.get('XDG_CONFIG_HOME') or ('~/Library/Preferences' if isosx else '~/.config')))
|
candidate = os.path.abspath(os.path.expanduser(os.environ.get('XDG_CONFIG_HOME') or ('~/Library/Preferences' if isosx else '~/.config')))
|
||||||
ans = os.path.join(candidate, appname)
|
ans = os.path.join(candidate, appname)
|
||||||
try:
|
os.makedirs(ans, exist_ok=True)
|
||||||
os.makedirs(ans)
|
|
||||||
except FileExistsError:
|
|
||||||
pass
|
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user