[lint] Remove redundant paranthesis
Remove redundant parenthisis around await expressions. Left over from f25091ef.
This commit is contained in:
parent
633192b3cd
commit
51d626eabe
@ -340,7 +340,7 @@ class BotBase(GroupMixin):
|
|||||||
if len(data) == 0:
|
if len(data) == 0:
|
||||||
return True
|
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):
|
async def is_owner(self, user):
|
||||||
"""Checks if a :class:`.User` or :class:`.Member` is the owner of
|
"""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:
|
if ctx.command is not None:
|
||||||
self.dispatch('command', ctx)
|
self.dispatch('command', ctx)
|
||||||
try:
|
try:
|
||||||
if (await self.can_run(ctx, call_once=True)):
|
if await self.can_run(ctx, call_once=True):
|
||||||
await ctx.command.invoke(ctx)
|
await ctx.command.invoke(ctx)
|
||||||
except CommandError as exc:
|
except CommandError as exc:
|
||||||
await ctx.command.dispatch_error(ctx, exc)
|
await ctx.command.dispatch_error(ctx, exc)
|
||||||
|
@ -349,7 +349,7 @@ class Command:
|
|||||||
argument = quoted_word(view)
|
argument = quoted_word(view)
|
||||||
view.previous = previous
|
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):
|
async def _transform_greedy_pos(self, ctx, param, required, converter):
|
||||||
view = ctx.view
|
view = ctx.view
|
||||||
@ -514,7 +514,7 @@ class Command:
|
|||||||
if not self.enabled:
|
if not self.enabled:
|
||||||
raise DisabledCommand('{0.name} command is disabled'.format(self))
|
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))
|
raise CheckFailure('The check functions for command {0.qualified_name} failed.'.format(self))
|
||||||
|
|
||||||
async def call_before_hooks(self, ctx):
|
async def call_before_hooks(self, ctx):
|
||||||
@ -793,7 +793,7 @@ class Command:
|
|||||||
ctx.command = self
|
ctx.command = self
|
||||||
|
|
||||||
try:
|
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))
|
raise CheckFailure('The global check functions for command {0.qualified_name} failed.'.format(self))
|
||||||
|
|
||||||
cog = self.instance
|
cog = self.instance
|
||||||
@ -812,7 +812,7 @@ class Command:
|
|||||||
# since we have no checks, then we just return True.
|
# since we have no checks, then we just return True.
|
||||||
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:
|
finally:
|
||||||
ctx.command = original
|
ctx.command = original
|
||||||
|
|
||||||
@ -1376,7 +1376,7 @@ def is_owner():
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
async def predicate(ctx):
|
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.')
|
raise NotOwner('You do not own this bot.')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ class HelpFormatter:
|
|||||||
|
|
||||||
cmd = tup[1]
|
cmd = tup[1]
|
||||||
try:
|
try:
|
||||||
return (await cmd.can_run(self.context))
|
return await cmd.can_run(self.context)
|
||||||
except CommandError:
|
except CommandError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ class HelpFormatter:
|
|||||||
"""
|
"""
|
||||||
self.context = context
|
self.context = context
|
||||||
self.command = command_or_bot
|
self.command = command_or_bot
|
||||||
return (await self.format())
|
return await self.format()
|
||||||
|
|
||||||
async def format(self):
|
async def format(self):
|
||||||
"""Handles the actual behaviour involved with formatting.
|
"""Handles the actual behaviour involved with formatting.
|
||||||
|
@ -229,7 +229,7 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
|||||||
except websockets.exceptions.ConnectionClosed:
|
except websockets.exceptions.ConnectionClosed:
|
||||||
# ws got closed so let's just do a regular IDENTIFY connect.
|
# ws got closed so let's just do a regular IDENTIFY connect.
|
||||||
log.info('RESUME failed (the websocket decided to close) for Shard ID %s. Retrying.', shard_id)
|
log.info('RESUME failed (the websocket decided to close) for Shard ID %s. Retrying.', shard_id)
|
||||||
return (await cls.from_client(client, shard_id=shard_id))
|
return await cls.from_client(client, shard_id=shard_id)
|
||||||
else:
|
else:
|
||||||
return ws
|
return ws
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ class HTTPClient:
|
|||||||
async def get_attachment(self, url):
|
async def get_attachment(self, url):
|
||||||
async with self._session.get(url) as resp:
|
async with self._session.get(url) as resp:
|
||||||
if resp.status == 200:
|
if resp.status == 200:
|
||||||
return (await resp.read())
|
return await resp.read()
|
||||||
elif resp.status == 404:
|
elif resp.status == 404:
|
||||||
raise NotFound(resp, 'attachment not found')
|
raise NotFound(resp, 'attachment not found')
|
||||||
elif resp.status == 403:
|
elif resp.status == 403:
|
||||||
|
@ -98,7 +98,7 @@ class _MappedAsyncIterator(_AsyncIterator):
|
|||||||
async def next(self):
|
async def next(self):
|
||||||
# this raises NoMoreItems and will propagate appropriately
|
# this raises NoMoreItems and will propagate appropriately
|
||||||
item = await self.iterator.next()
|
item = await self.iterator.next()
|
||||||
return (await maybe_coroutine(self.func, item))
|
return await maybe_coroutine(self.func, item)
|
||||||
|
|
||||||
class _FilteredAsyncIterator(_AsyncIterator):
|
class _FilteredAsyncIterator(_AsyncIterator):
|
||||||
def __init__(self, iterator, predicate):
|
def __init__(self, iterator, predicate):
|
||||||
|
@ -214,7 +214,7 @@ class AutoShardedClient(Client):
|
|||||||
except Exception:
|
except Exception:
|
||||||
log.info('Failed to connect for shard_id: %s. Retrying...', shard_id)
|
log.info('Failed to connect for shard_id: %s. Retrying...', shard_id)
|
||||||
await asyncio.sleep(5.0, loop=self.loop)
|
await asyncio.sleep(5.0, loop=self.loop)
|
||||||
return (await self.launch_shard(gateway, shard_id))
|
return await self.launch_shard(gateway, shard_id)
|
||||||
|
|
||||||
ws.token = self.http.token
|
ws.token = self.http.token
|
||||||
ws._connection = self._connection
|
ws._connection = self._connection
|
||||||
@ -231,7 +231,7 @@ class AutoShardedClient(Client):
|
|||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
log.info('Timed out when connecting for shard_id: %s. Retrying...', shard_id)
|
log.info('Timed out when connecting for shard_id: %s. Retrying...', shard_id)
|
||||||
await asyncio.sleep(5.0, loop=self.loop)
|
await asyncio.sleep(5.0, loop=self.loop)
|
||||||
return (await self.launch_shard(gateway, shard_id))
|
return await self.launch_shard(gateway, shard_id)
|
||||||
|
|
||||||
# keep reading the shard while others connect
|
# keep reading the shard while others connect
|
||||||
self.shards[shard_id] = ret = Shard(ws, self)
|
self.shards[shard_id] = ret = Shard(ws, self)
|
||||||
|
@ -271,7 +271,7 @@ def _parse_ratelimit_header(request):
|
|||||||
async def maybe_coroutine(f, *args, **kwargs):
|
async def maybe_coroutine(f, *args, **kwargs):
|
||||||
value = f(*args, **kwargs)
|
value = f(*args, **kwargs)
|
||||||
if _isawaitable(value):
|
if _isawaitable(value):
|
||||||
return (await value)
|
return await value
|
||||||
else:
|
else:
|
||||||
return value
|
return value
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user