diff options
| author | Rapptz <[email protected]> | 2016-02-24 15:14:20 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-02-24 15:14:20 -0500 |
| commit | bf2b8744a5e6077c709bbc75d83f3241180f38d6 (patch) | |
| tree | 99918d0414b37c00475b8668b715c3dbeff91438 | |
| parent | Fix bug where the everyone role was not being properly resolved. (diff) | |
| download | discord.py-bf2b8744a5e6077c709bbc75d83f3241180f38d6.tar.xz discord.py-bf2b8744a5e6077c709bbc75d83f3241180f38d6.zip | |
[commands] Do not swallow AttributeErrors raised by the setup function
| -rw-r--r-- | discord/ext/commands/bot.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 0bdb9dd8..d0f21b44 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -482,11 +482,10 @@ class Bot(GroupMixin, discord.Client): return lib = importlib.import_module(name) - try: - lib.setup(self) - except AttributeError as e: - raise discord.ClientException('extension does not have a setup function') from e + if not hasattr(lib, 'setup'): + raise discord.ClientException('extension does not have a setup function') + lib.setup(self) self.extensions[name] = lib def unload_extension(self, name): |