3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

control: copy world.networkobjects to prevent RuntimeError

i.e.: RuntimeError: dictionary changed size during iteration
This commit is contained in:
James Lu 2016-07-01 22:20:24 -07:00
parent 7c6daa839c
commit 8704114fa0

View File

@ -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)