From 51b545358738b0f55873822f84cc5865801490ae Mon Sep 17 00:00:00 2001 From: sumitsharansatsangi Date: Wed, 17 Aug 2022 13:47:08 +0530 Subject: [PATCH] more linter error fixed --- piccolo_api/shared/middleware/junction.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/piccolo_api/shared/middleware/junction.py b/piccolo_api/shared/middleware/junction.py index b73508de..00fadba7 100644 --- a/piccolo_api/shared/middleware/junction.py +++ b/piccolo_api/shared/middleware/junction.py @@ -1,3 +1,5 @@ +import typing as t + from starlette.exceptions import HTTPException from starlette.routing import Router from starlette.types import Receive, Scope, Send @@ -15,12 +17,14 @@ def __init__(self, *routers: Router) -> None: async def __call__(self, scope: Scope, receive: Receive, send: Send): for router in self.routers: try: - asgi = await router(scope, receive=receive, send=send) + response: t.Any | None = await router( + scope, receive=receive, send=send + ) except HTTPException as exception: if exception.status_code != 404: raise exception else: - if getattr(asgi, "status_code", None) == 404: + if getattr(response, "status_code", None) == 404: continue return