[Bf-blender-cvs] [a3e9d84] blender-v2.75-release: Fix addon_utils.check

Campbell Barton noreply at git.blender.org
Thu Jun 18 17:37:11 CEST 2015


Commit: a3e9d842ae0e837cf5a05e5917ffc9a8cb7aa44f
Author: Campbell Barton
Date:   Sun Jun 14 21:04:51 2015 +1000
Branches: blender-v2.75-release
https://developer.blender.org/rBa3e9d842ae0e837cf5a05e5917ffc9a8cb7aa44f

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