aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-12-17 21:18:48 -0500
committerRapptz <[email protected]>2016-12-17 21:18:48 -0500
commit00e30f3106cdd3e1e0728af3046b7a002454a31c (patch)
treefb0ed9b7ab04dbe068a8204d245274a20db77f6e
parent[commands] Unload all cogs when gracefully exiting bot. (diff)
downloaddiscord.py-00e30f3106cdd3e1e0728af3046b7a002454a31c.tar.xz
discord.py-00e30f3106cdd3e1e0728af3046b7a002454a31c.zip
[commands] Shield against dictionary resize in Bot.close
-rw-r--r--discord/ext/commands/bot.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index 77123db5..349e5d0d 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -268,13 +268,13 @@ class Bot(GroupMixin, discord.Client):
@asyncio.coroutine
def close(self):
- for extension in self.extensions:
+ for extension in tuple(self.extensions):
try:
self.unload_extension(extension)
except:
pass
- for cog in self.cogs:
+ for cog in tuple(self.cogs):
try:
self.remove_cog(cog)
except: