Skip to content

Commit

Permalink
Silence mypy error in AbstractRoute ctor (aio-libs#3927)
Browse files Browse the repository at this point in the history
- Don't reuse variable to decomplicate logic
- Silence error at return line as mypy cannot deduce that result
  cannot be Awaitable after the 'if'
  • Loading branch information
AMDmi3 committed Jul 22, 2019
1 parent a1feb09 commit 69784b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 69784b4

Please sign in to comment.