Cleanup: explain why checking the enabled state twice is needed

Address concern raised with the commit that added this extra check.
This commit is contained in:
Campbell Barton 2020-08-17 12:33:07 +10:00
parent 5c78c16b14
commit cafe5cd9b0
1 changed files with 2 additions and 0 deletions

View File

@ -492,6 +492,8 @@ def disable_all():
item for item in sys.modules.items()
if getattr(item[1], "__addon_enabled__", False)
]
# Check the enabled state again since it's possible the disable call
# of one add-on disables others.
for mod_name, mod in addon_modules:
if getattr(mod, "__addon_enabled__", False):
disable(mod_name)