From 8704114fa067660be1f17807e69875db6b30bfb0 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 1 Jul 2016 22:20:24 -0700 Subject: [PATCH] control: copy world.networkobjects to prevent RuntimeError i.e.: RuntimeError: dictionary changed size during iteration --- coremods/control.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coremods/control.py b/coremods/control.py index 8ba2e9d..a94254b 100644 --- a/coremods/control.py +++ b/coremods/control.py @@ -25,7 +25,7 @@ def _shutdown(irc=None): except: # But don't allow it to crash the server. log.exception('coremods.control: Error occurred in die() of plugin %s, skipping...', name) - for ircobj in world.networkobjects.values(): + for ircobj in world.networkobjects.copy().values(): # Disconnect all our networks. remove_network(ircobj)