From 98c2a4fb57d06a387947a0ff22634a8a55a821ee Mon Sep 17 00:00:00 2001 From: "Oleg A." Date: Thu, 1 Aug 2024 01:37:07 +0300 Subject: [PATCH] fixed ruff issues (#1549) --- aiogram/utils/formatting.py | 2 +- examples/multibot.py | 2 +- examples/web_app/routes.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/aiogram/utils/formatting.py b/aiogram/utils/formatting.py index 145eadcf..929afc07 100644 --- a/aiogram/utils/formatting.py +++ b/aiogram/utils/formatting.py @@ -171,7 +171,7 @@ class Text(Iterable[NodeType]): def __add__(self, other: NodeType) -> "Text": if isinstance(other, Text) and other.type == self.type and self._params == other._params: return type(self)(*self, *other, **self._params) - if type(self) == Text and isinstance(other, str): + if type(self) is Text and isinstance(other, str): return type(self)(*self, other, **self._params) return Text(self, other) diff --git a/examples/multibot.py b/examples/multibot.py index d5dbe5fc..82fac4a1 100644 --- a/examples/multibot.py +++ b/examples/multibot.py @@ -4,7 +4,6 @@ from os import getenv from typing import Any, Dict, Union from aiohttp import web -from finite_state_machine import form_router from aiogram import Bot, Dispatcher, F, Router from aiogram.client.session.aiohttp import AiohttpSession @@ -19,6 +18,7 @@ from aiogram.webhook.aiohttp_server import ( TokenBasedRequestHandler, setup_application, ) +from finite_state_machine import form_router main_router = Router() diff --git a/examples/web_app/routes.py b/examples/web_app/routes.py index a1f2da3d..b10b0554 100644 --- a/examples/web_app/routes.py +++ b/examples/web_app/routes.py @@ -43,7 +43,9 @@ async def send_message_handler(request: Request): [ InlineKeyboardButton( text="Open", - web_app=WebAppInfo(url=str(request.url.with_scheme("https").with_path("demo"))), + web_app=WebAppInfo( + url=str(request.url.with_scheme("https").with_path("demo")) + ), ) ] ]