From 834413e2521cb1c9fc7321424bc1b8d929c015b6 Mon Sep 17 00:00:00 2001 From: Pavel Kirilin Date: Tue, 1 Oct 2024 09:52:00 +0200 Subject: [PATCH] Small warning fixes. --- aiohttp_deps/initializer.py | 8 ++++---- aiohttp_deps/swagger.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aiohttp_deps/initializer.py b/aiohttp_deps/initializer.py index 6b03cbd..08351f4 100644 --- a/aiohttp_deps/initializer.py +++ b/aiohttp_deps/initializer.py @@ -126,8 +126,8 @@ async def init(app: web.Application) -> None: :param app: current application. """ for route in app.router.routes(): - if inspect.isclass(route._handler): - if issubclass(route._handler, View): - route._handler = InjectableViewHandler(route._handler) + if inspect.isclass(route.handler): + if issubclass(route.handler, View): + route._handler = InjectableViewHandler(route.handler) continue - route._handler = InjectableFuncHandler(route._handler) + route._handler = InjectableFuncHandler(route.handler) diff --git a/aiohttp_deps/swagger.py b/aiohttp_deps/swagger.py index 81adea2..2dd3e8d 100644 --- a/aiohttp_deps/swagger.py +++ b/aiohttp_deps/swagger.py @@ -288,7 +288,7 @@ async def event_handler(app: web.Application) -> None: # noqa: C901 extra_openapi_schemas=route_extra_schemas, ) except Exception as exc: # pragma: no cover - logger.warn( + logger.warning( "Cannot add route info: %s", exc, exc_info=True, @@ -316,7 +316,7 @@ async def event_handler(app: web.Application) -> None: # noqa: C901 extra_openapi_schemas=route_extra_schemas, ) except Exception as exc: # pragma: no cover - logger.warn( + logger.warning( "Cannot add route info: %s", exc, exc_info=True,