diff options
Diffstat (limited to 'discord/ext')
| -rw-r--r-- | discord/ext/commands/bot.py | 4 | ||||
| -rw-r--r-- | discord/ext/commands/converter.py | 4 | ||||
| -rw-r--r-- | discord/ext/commands/core.py | 20 |
3 files changed, 14 insertions, 14 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index 04a5452f..b934be9b 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -897,8 +897,8 @@ class BotBase(GroupMixin): try: if (await self.can_run(ctx, call_once=True)): await ctx.command.invoke(ctx) - except CommandError as e: - await ctx.command.dispatch_error(ctx, e) + except CommandError as exc: + await ctx.command.dispatch_error(ctx, exc) else: self.dispatch('command_completion', ctx) elif ctx.invoked_with: diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py index a66a61f3..de189e6c 100644 --- a/discord/ext/commands/converter.py +++ b/discord/ext/commands/converter.py @@ -343,8 +343,8 @@ class InviteConverter(Converter): try: invite = await ctx.bot.get_invite(argument) return invite - except Exception as e: - raise BadArgument('Invite is invalid or expired') from e + except Exception as exc: + raise BadArgument('Invite is invalid or expired') from exc class EmojiConverter(IDConverter): """Converts to a :class:`Emoji`. diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 8e28159d..e2e68192 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -49,8 +49,8 @@ def wrap_callback(coro): raise except asyncio.CancelledError: return - except Exception as e: - raise CommandInvokeError(e) from e + except Exception as exc: + raise CommandInvokeError(exc) from exc return ret return wrapped @@ -65,9 +65,9 @@ def hooked_wrapped_callback(command, ctx, coro): except asyncio.CancelledError: ctx.command_failed = True return - except Exception as e: + except Exception as exc: ctx.command_failed = True - raise CommandInvokeError(e) from e + raise CommandInvokeError(exc) from exc finally: await command.call_after_hooks(ctx) return ret @@ -262,20 +262,20 @@ class Command: return ret except CommandError: raise - except Exception as e: - raise ConversionError(converter, e) from e + except Exception as exc: + raise ConversionError(converter, exc) from exc try: return converter(argument) except CommandError: raise - except Exception as e: + except Exception as exc: try: name = converter.__name__ except AttributeError: name = converter.__class__.__name__ - raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from e + raise BadArgument('Converting to "{}" failed for parameter "{}".'.format(name, param.name)) from exc async def do_conversion(self, ctx, converter, argument, param): try: @@ -296,8 +296,8 @@ class Command: try: value = await self._actual_conversion(ctx, conv, argument, param) - except CommandError as e: - errors.append(e) + except CommandError as exc: + errors.append(exc) else: return value |