diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-19 09:51:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-19 09:51:40 +0300 |
commit | 3f542312cfe7e73122aaa1140a36ed4da7791d8e (patch) | |
tree | 6b3731b25ed97fc766a10673b24404c6268e3ede /release/scripts/modules | |
parent | 13a797466b0dd1a1e1158362036bcf9197123665 (diff) | |
parent | 0bbc6a903a5baf4782b99c70bee6c45fd017c519 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/addon_utils.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py index 77e0d38f205..c0d45822503 100644 --- a/release/scripts/modules/addon_utils.py +++ b/release/scripts/modules/addon_utils.py @@ -498,7 +498,12 @@ def reset_all(*, reload_scripts=False): def disable_all(): import sys - for mod_name, mod in sys.modules.items(): + # Collect modules to disable first because dict can be modified as we disable. + addon_modules = [ + item for item in sys.modules.items() + if getattr(item[1], "__addon_enabled__", False) + ] + for mod_name, mod in addon_modules: if getattr(mod, "__addon_enabled__", False): disable(mod_name) |