[Bf-blender-cvs] [b9fe261] master: Fix addon_utils.check

Campbell Barton noreply at git.blender.org
Sun Jun 14 14:31:12 CEST 2015


Commit: b9fe261255cba067c055caac603e9abe4d089e84
Author: Campbell Barton
Date:   Sun Jun 14 21:04:51 2015 +1000
Branches: master
https://developer.blender.org/rBb9fe261255cba067c055caac603e9abe4d089e84

Fix addon_utils.check

Second return value could be None instead of False.

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

M	release/scripts/modules/addon_utils.py

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

diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index 63b01a4..4168f0a 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -219,7 +219,8 @@ def check(module_name):
     loaded_default = module_name in _user_preferences.addons
 
     mod = sys.modules.get(module_name)
-    loaded_state = mod and getattr(mod, "__addon_enabled__", Ellipsis)
+    loaded_state = ((mod is not None) and
+                    getattr(mod, "__addon_enabled__", Ellipsis))
 
     if loaded_state is Ellipsis:
         print("Warning: addon-module %r found module "




More information about the Bf-blender-cvs mailing list