code cleanup: use exist_ok keyword arg to os.makedirs() rather then checking if the dir exists first.

This commit is contained in:
Campbell Barton
2013-02-07 04:02:24 +00:00
parent 0152d11e01
commit 4b8fe80e6e
2 changed files with 2 additions and 6 deletions

View File

@@ -1740,8 +1740,7 @@ class WM_OT_addon_install(Operator):
return {'CANCELLED'}
# create dir is if missing.
if not os.path.exists(path_addons):
os.makedirs(path_addons)
os.makedirs(path_addons, exist_ok=True)
# Check if we are installing from a target path,
# doing so causes 2+ addons of same name or when the same from/to