Another place we can use exist_ok

This commit is contained in:
Kovid Goyal 2017-06-09 00:00:02 +05:30
parent 2f21e0e341
commit ea298f95f2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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')))
ans = os.path.join(candidate, appname)
try:
os.makedirs(ans)
except FileExistsError:
pass
os.makedirs(ans, exist_ok=True)
return ans