Skip to content

Commit

Permalink
style: 删除无用的 type: ignore (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 authored Nov 6, 2024
1 parent 886d4c0 commit b2aebdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion alicebot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ def get_adapter(
if _adapter.name == adapter:
return _adapter
elif isinstance(_adapter, adapter):
return _adapter # pyright: ignore[reportUnknownVariableType]
return _adapter
raise LookupError(f'Can not find adapter named "{adapter}"')

def get_plugin(self, name: str) -> type[Plugin[Any, Any, Any]]:
Expand Down
4 changes: 2 additions & 2 deletions alicebot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def wrap_get_func(
async def _func(event: EventT) -> bool:
return (
(event_type is None or isinstance(event, event_type))
and (adapter_type is None or isinstance(event.adapter, adapter_type)) # pyright: ignore[reportUnknownMemberType]
and await func(event) # pyright: ignore[reportUnknownArgumentType]
and (adapter_type is None or isinstance(event.adapter, adapter_type))
and await func(event)
)

return _func
Expand Down

0 comments on commit b2aebdc

Please sign in to comment.