From 69784b480efa2608a0ce21366c932c2e781db743 Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Mon, 22 Jul 2019 23:37:05 +0300 Subject: [PATCH] Silence mypy error in AbstractRoute ctor (#3927) - Don't reuse variable to decomplicate logic - Silence error at return line as mypy cannot deduce that result cannot be Awaitable after the 'if' --- aiohttp/web_urldispatcher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index 6203544d531..fc6d28f32f2 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -155,8 +155,8 @@ def __init__(self, method: str, async def handler_wrapper(request: Request) -> StreamResponse: result = old_handler(request) if asyncio.iscoroutine(result): - result = await result - return result + return await result + return result # type: ignore old_handler = handler handler = handler_wrapper