[commands] Shield against dictionary resize in Bot.close
This commit is contained in:
parent
fc1a7183a0
commit
00e30f3106
@ -268,13 +268,13 @@ class Bot(GroupMixin, discord.Client):
|
|||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def close(self):
|
def close(self):
|
||||||
for extension in self.extensions:
|
for extension in tuple(self.extensions):
|
||||||
try:
|
try:
|
||||||
self.unload_extension(extension)
|
self.unload_extension(extension)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for cog in self.cogs:
|
for cog in tuple(self.cogs):
|
||||||
try:
|
try:
|
||||||
self.remove_cog(cog)
|
self.remove_cog(cog)
|
||||||
except:
|
except:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user