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>2018-10-19 09:49:16 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-10-19 09:49:48 +0300
commit0bbc6a903a5baf4782b99c70bee6c45fd017c519 (patch)
treed736423634f0cf48d4a2f2122be0a4778dbfece9 /release/scripts/modules/addon_utils.py
parentde3f9303eb958d34e4793ff91fafedda0b41ee98 (diff)
Fix error disabling all addons
Diffstat (limited to 'release/scripts/modules/addon_utils.py')
-rw-r--r--release/scripts/modules/addon_utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/release/scripts/modules/addon_utils.py b/release/scripts/modules/addon_utils.py
index dc7f4053a01..713a11362c6 100644
--- a/release/scripts/modules/addon_utils.py
+++ b/release/scripts/modules/addon_utils.py
@@ -472,7 +472,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)