Skip to content

Commit

Permalink
fix lint -_-
Browse files Browse the repository at this point in the history
  • Loading branch information
IAmTomahawkx committed Oct 8, 2023
1 parent 8f5ee02 commit 2f3d729
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions twitchio/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ async def _resolve(context: Context, arg: str) -> Any:

return _resolve

def _resolve_converter(self, name: str, converter: Union[Callable, Awaitable, type], ctx: Context) -> Callable[..., Any]:
def _resolve_converter(
self, name: str, converter: Union[Callable, Awaitable, type], ctx: Context
) -> Callable[..., Any]:
if (
isinstance(converter, type)
and converter.__module__.startswith("twitchio")
Expand All @@ -196,7 +198,7 @@ def _resolve_converter(self, name: str, converter: Union[Callable, Awaitable, ty
converter = self._convert_builtin_type(name, bool, _boolconverter)

elif converter in (str, int):
original: type[str | int] = converter # type: ignore
original: type[str | int] = converter # type: ignore
converter = self._convert_builtin_type(name, original, lambda _, arg: original(arg))

elif self._is_optional_argument(converter):
Expand All @@ -212,7 +214,10 @@ def _resolve_converter(self, name: str, converter: Union[Callable, Awaitable, ty
return converter # type: ignore

def _convert_builtin_type(
self, arg_name: str, original: type, converter: Union[Callable[[Context, str], Any], Callable[[Context, str], Awaitable[Any]]]
self,
arg_name: str,
original: type,
converter: Union[Callable[[Context, str], Any], Callable[[Context, str], Awaitable[Any]]],
) -> Callable[[Context, str], Awaitable[Any]]:
async def resolve(ctx, arg: str) -> Any:
try:
Expand Down

0 comments on commit 2f3d729

Please sign in to comment.