An attempt to prevent the ugly exceptions from being raised on quit.

This commit is contained in:
Jeremy Fincher 2004-01-15 11:48:23 +00:00
parent 69f61d7b6e
commit 74961db20e

View File

@ -325,7 +325,12 @@ class Owner(privmsgs.CapabilityCheckingPrivmsg):
world.dying = True
for driver in drivers._drivers.itervalues():
driver.die()
killed = sets.Set()
for irc in world.ircs[:]:
# The following is so callbacks don't get killed multiple times
# when the Relay plugin is loaded:
if id(irc.callbacks) not in killed:
killed.add(id(irc.callbacks))
irc.die()
raise SystemExit, 'Quitting because I was told by %s' % msg.prefix