diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 0bdb9dd80..d0f21b44c 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):