From 87a87dfdcb4bd24fba4126cc90fb5ea6c30f260a Mon Sep 17 00:00:00 2001 From: Dmitry Marakasov Date: Mon, 22 Jul 2019 23:33:23 +0300 Subject: [PATCH] Silence mypy on awaits (#3927) error: Incompatible types in "await" (actual type "Generator[Any, None, AbstractServer]", expected type "Awaitable[Any]") Not sure how to fix, may be a typeshed problem --- aiohttp/connector.py | 2 +- aiohttp/web_runner.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aiohttp/connector.py b/aiohttp/connector.py index 706bc99adb7..8f8ca1f1e02 100644 --- a/aiohttp/connector.py +++ b/aiohttp/connector.py @@ -902,7 +902,7 @@ async def _wrap_create_connection( with CeilTimeout(timeout.sock_connect): return cast( Tuple[asyncio.Transport, ResponseHandler], - await self._loop.create_connection(*args, **kwargs)) + await self._loop.create_connection(*args, **kwargs)) # type: ignore # noqa except cert_errors as exc: raise ClientConnectorCertificateError( req.connection_key, exc) from exc diff --git a/aiohttp/web_runner.py b/aiohttp/web_runner.py index cdd5ac7ce54..fa7f3bc4545 100644 --- a/aiohttp/web_runner.py +++ b/aiohttp/web_runner.py @@ -104,7 +104,7 @@ async def start(self) -> None: loop = asyncio.get_event_loop() server = self._runner.server assert server is not None - self._server = await loop.create_server( + self._server = await loop.create_server( # type: ignore server, self._host, self._port, ssl=self._ssl_context, backlog=self._backlog, reuse_address=self._reuse_address, @@ -191,7 +191,7 @@ async def start(self) -> None: loop = asyncio.get_event_loop() server = self._runner.server assert server is not None - self._server = await loop.create_server( + self._server = await loop.create_server( # type: ignore server, sock=self._sock, ssl=self._ssl_context, backlog=self._backlog)