quiet error installing an addon when the directory already exists (would happen on...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 20 Aug 2013 14:43:01 +0000 (14:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 20 Aug 2013 14:43:01 +0000 (14:43 +0000)
the addon would install but error was misleading.

release/scripts/startup/bl_operators/wm.py

index 63d9aa31dddd46a310a443f589f368945416ebb3..5095bfdd9d26a398267281c464d65c81962c2f10 100644 (file)
@@ -1762,12 +1762,12 @@ class WM_OT_addon_install(Operator):
             self.report({'ERROR'}, "Failed to get addons path")
             return {'CANCELLED'}
 
-        # create dir is if missing.
-        try:
-            os.makedirs(path_addons, exist_ok=True)
-        except:
-            import traceback
-            traceback.print_exc()
+        if not os.path.isdir(path_addons):
+            try:
+                os.makedirs(path_addons, exist_ok=True)
+            except:
+                import traceback
+                traceback.print_exc()
 
         # Check if we are installing from a target path,
         # doing so causes 2+ addons of same name or when the same from/to