Fix #121021: Avoid size change of addon_modules
during iteration #121100
|
@ -584,8 +584,9 @@ def disable_all():
|
|||
#
|
||||
# Either way, running 3rd party logic here can cause undefined behavior.
|
||||
# Use direct `__dict__` access to bypass `__getattr__`, see: #111649.
|
||||
modules = sys.modules.copy()
|
||||
addon_modules = [
|
||||
item for item in sys.modules.items()
|
||||
item for item in modules.items()
|
||||
ChengduLittleA marked this conversation as resolved
Outdated
|
||||
if type(mod_dict := getattr(item[1], "__dict__", None)) is dict
|
||||
if mod_dict.get("__addon_enabled__")
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
This should still call
.items()
, otherwise it'll be iterating over the dictionary keys instead.