[Downloader] Suppress commands.ExtensionNotLoaded for bot.unload_extension() call (#2625)

fix(downloader): suppress `commands.ExtensionNotLoaded` for `bot.unload_extension()` call (#2625)
This commit is contained in:
jack1142 2019-04-29 18:42:36 +02:00 committed by Michael H
parent 24ac111782
commit 1ce3bc2870

View File

@ -364,7 +364,8 @@ class Downloader(commands.Cog):
poss_installed_path = (await self.cog_install_path()) / real_name
if poss_installed_path.exists():
ctx.bot.unload_extension(real_name)
with contextlib.suppress(commands.ExtensionNotLoaded):
ctx.bot.unload_extension(real_name)
await self._delete_cog(poss_installed_path)
uninstalled_cogs.append(inline(real_name))
else: