Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-02-12 15:42:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-02-12 15:44:37 +0300
commite408e632a110a8cf4537c4fcdb5a47478b6110cd (patch)
treede2297f39c44cb4023c86356c93c4549c8851092 /release/scripts
parent3b68a74c2a142f7962ed1ff9ab2c99e438937277 (diff)
Addons: print short message if an addons missing
Was printing full traceback, harmless but verbose.
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/modules/addon_utils.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index d955985d68f..8c86f31022c 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -306,8 +306,13 @@ def enable(module_name, default_set=False, persistent=False, handle_error=None):
mod = __import__(module_name)
mod.__time__ = os.path.getmtime(mod.__file__)
mod.__addon_enabled__ = False
- except:
- handle_error()
+ except Exception as ex:
+ # if the addon doesn't exist, dont print full traceback
+ if type(ex) is ImportError and ex.name == module_name:
+ print("addon not found: %r" % module_name)
+ else:
+ handle_error()
+
if default_set:
_addon_remove(module_name)
return None