From 51d626eabef3b8310478c6a88c88b2a3cc290bde Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Thu, 9 Aug 2018 14:15:44 +0200 Subject: =?UTF-8?q?[lint]=C2=A0Remove=20redundant=20paranthesis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove redundant parenthisis around await expressions. Left over from f25091ef. --- discord/ext/commands/bot.py | 4 ++-- discord/ext/commands/core.py | 10 +++++----- discord/ext/commands/formatter.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'discord/ext') diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index b934be9b..487636c5 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -340,7 +340,7 @@ class BotBase(GroupMixin): if len(data) == 0: return True - return (await discord.utils.async_all(f(ctx) for f in data)) + return await discord.utils.async_all(f(ctx) for f in data) async def is_owner(self, user): """Checks if a :class:`.User` or :class:`.Member` is the owner of @@ -895,7 +895,7 @@ class BotBase(GroupMixin): if ctx.command is not None: self.dispatch('command', ctx) try: - if (await self.can_run(ctx, call_once=True)): + if await self.can_run(ctx, call_once=True): await ctx.command.invoke(ctx) except CommandError as exc: await ctx.command.dispatch_error(ctx, exc) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index e2e68192..e871936c 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -349,7 +349,7 @@ class Command: argument = quoted_word(view) view.previous = previous - return (await self.do_conversion(ctx, converter, argument, param)) + return await self.do_conversion(ctx, converter, argument, param) async def _transform_greedy_pos(self, ctx, param, required, converter): view = ctx.view @@ -514,7 +514,7 @@ class Command: if not self.enabled: raise DisabledCommand('{0.name} command is disabled'.format(self)) - if not (await self.can_run(ctx)): + if not await self.can_run(ctx): raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self)) async def call_before_hooks(self, ctx): @@ -793,7 +793,7 @@ class Command: ctx.command = self try: - if not (await ctx.bot.can_run(ctx)): + if not await ctx.bot.can_run(ctx): raise CheckFailure('The global check functions for command {0.qualified_name} failed.'.format(self)) cog = self.instance @@ -812,7 +812,7 @@ class Command: # since we have no checks, then we just return True. return True - return (await discord.utils.async_all(predicate(ctx) for predicate in predicates)) + return await discord.utils.async_all(predicate(ctx) for predicate in predicates) finally: ctx.command = original @@ -1376,7 +1376,7 @@ def is_owner(): """ async def predicate(ctx): - if not (await ctx.bot.is_owner(ctx.author)): + if not await ctx.bot.is_owner(ctx.author): raise NotOwner('You do not own this bot.') return True diff --git a/discord/ext/commands/formatter.py b/discord/ext/commands/formatter.py index f23a697b..ba120f92 100644 --- a/discord/ext/commands/formatter.py +++ b/discord/ext/commands/formatter.py @@ -228,7 +228,7 @@ class HelpFormatter: cmd = tup[1] try: - return (await cmd.can_run(self.context)) + return await cmd.can_run(self.context) except CommandError: return False @@ -274,7 +274,7 @@ class HelpFormatter: """ self.context = context self.command = command_or_bot - return (await self.format()) + return await self.format() async def format(self): """Handles the actual behaviour involved with formatting. -- cgit v1.2.3