Another place we can use exist_ok
This commit is contained in:
parent
2f21e0e341
commit
ea298f95f2
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user