diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-06-10 12:33:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-06-10 12:33:38 +0300 |
commit | 0446c73c4a368d8393f434fbe745ada54e4225d3 (patch) | |
tree | 8e700b4c2a2caaf4d1367067524ff1bc37a7bb22 /release/scripts/startup/bl_operators/wm.py | |
parent | bc69eafa9838b12c6996b759b27df3445ed86e52 (diff) |
WM: toggling expanded could raise exception
Missing module case wasn't checked for.
Diffstat (limited to 'release/scripts/startup/bl_operators/wm.py')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index c6ca9fe9208..ebb859f7fa1 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'} |