aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2019-07-27 22:37:55 -0400
committerRapptz <[email protected]>2019-07-27 22:37:55 -0400
commitdd12fbf73d022f66d9d4927881697bcbec318c81 (patch)
treeead7226fbc253fdd1feed6b3271f8e3fc4bd2e03
parentEscape quote markdown in utils.escape_markdown (diff)
downloaddiscord.py-dd12fbf73d022f66d9d4927881697bcbec318c81.tar.xz
discord.py-dd12fbf73d022f66d9d4927881697bcbec318c81.zip
[commands] Properly load the original module when reloading fails.
Fix #2291
-rw-r--r--discord/ext/commands/bot.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py
index a4b18c64..2f07a85f 100644
--- a/discord/ext/commands/bot.py
+++ b/discord/ext/commands/bot.py
@@ -286,7 +286,7 @@ class BotBase(GroupMixin):
async def is_owner(self, user):
"""|coro|
-
+
Checks if a :class:`~discord.User` or :class:`~discord.Member` is the owner of
this bot.
@@ -729,7 +729,8 @@ class BotBase(GroupMixin):
# if the load failed, the remnants should have been
# cleaned from the load_extension function call
# so let's load it from our old compiled library.
- self._load_from_module_spec(lib, name)
+ lib.setup(self)
+ self.__extensions[name] = lib
# revert sys.modules back to normal and raise back to caller
sys.modules.update(modules)