[Bf-blender-cvs] [0446c73] master: WM: toggling expanded could raise exception

Campbell Barton noreply at git.blender.org
Wed Jun 10 11:35:41 CEST 2015


Commit: 0446c73c4a368d8393f434fbe745ada54e4225d3
Author: Campbell Barton
Date:   Wed Jun 10 19:33:38 2015 +1000
Branches: master
https://developer.blender.org/rB0446c73c4a368d8393f434fbe745ada54e4225d3

WM: toggling expanded could raise exception

Missing module case wasn't checked for.

===================================================================

M	release/scripts/startup/bl_operators/wm.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index c6ca9fe..ebb859f 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -2108,15 +2108,9 @@ class WM_OT_addon_expand(Operator):
 
         module_name = self.module
 
-        # unlikely to fail, module should have already been imported
-        try:
-            # mod = __import__(module_name)
-            mod = addon_utils.addons_fake_modules.get(module_name)
-        except:
-            import traceback
-            traceback.print_exc()
-            return {'CANCELLED'}
+        mod = addon_utils.addons_fake_modules.get(module_name)
+        if mod is not None:
+            info = addon_utils.module_bl_info(mod)
+            info["show_expanded"] = not info["show_expanded"]
 
-        info = addon_utils.module_bl_info(mod)
-        info["show_expanded"] = not info["show_expanded"]
         return {'FINISHED'}




More information about the Bf-blender-cvs mailing list