From 4ae8e816603ce8df6242dcd85174514972067448 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Wed, 1 Aug 2018 11:36:46 +0200 Subject: [lint] Remove redundant exception variables Use bare raise statement when reraising the exception that occured, and remove unused exception variables. Also remove a pointless exception handler in discord.opus. --- discord/ext/commands/core.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'discord/ext') diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index bcf2cd8a..8e28159d 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -260,15 +260,15 @@ class Command: elif isinstance(converter, converters.Converter): ret = await converter.convert(ctx, argument) return ret - except CommandError as e: - raise e + except CommandError: + raise except Exception as e: raise ConversionError(converter, e) from e try: return converter(argument) - except CommandError as e: - raise e + except CommandError: + raise except Exception as e: try: name = converter.__name__ @@ -363,7 +363,7 @@ class Command: argument = quoted_word(view) try: value = await self.do_conversion(ctx, converter, argument, param) - except CommandError as e: + except CommandError: if not result: if required: raise -- cgit v1.2.3