diff options
| author | Rapptz <[email protected]> | 2016-08-10 15:09:07 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-08-10 15:11:45 -0400 |
| commit | 1e9251cfefe5e4ce70094b90c000334ca431e954 (patch) | |
| tree | 8391abb2f6c97c0ceaee09566d4d214b1ff4b29d | |
| parent | Emoji.url uses api url. (diff) | |
| download | discord.py-1e9251cfefe5e4ce70094b90c000334ca431e954.tar.xz discord.py-1e9251cfefe5e4ce70094b90c000334ca431e954.zip | |
[commands] Delete module when it does not have a setup function.
| -rw-r--r-- | discord/ext/commands/bot.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 7250f3a6..d9e02f1f 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -712,6 +712,8 @@ class Bot(GroupMixin, discord.Client): lib = importlib.import_module(name) if not hasattr(lib, 'setup'): + del lib + del sys.modules[name] raise discord.ClientException('extension does not have a setup function') lib.setup(self) |