mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +00:00
[commands] Do not swallow AttributeErrors raised by the setup function
This commit is contained in:
parent
13f8b972e6
commit
bf2b8744a5
@ -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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user