[commands] Do not swallow AttributeErrors raised by the setup function
This commit is contained in:
		| @@ -482,11 +482,10 @@ class Bot(GroupMixin, discord.Client): | |||||||
|             return |             return | ||||||
|  |  | ||||||
|         lib = importlib.import_module(name) |         lib = importlib.import_module(name) | ||||||
|         try: |         if not hasattr(lib, 'setup'): | ||||||
|             lib.setup(self) |             raise discord.ClientException('extension does not have a setup function') | ||||||
|         except AttributeError as e: |  | ||||||
|             raise discord.ClientException('extension does not have a setup function') from e |  | ||||||
|  |  | ||||||
|  |         lib.setup(self) | ||||||
|         self.extensions[name] = lib |         self.extensions[name] = lib | ||||||
|  |  | ||||||
|     def unload_extension(self, name): |     def unload_extension(self, name): | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user