From e0db8a81391d0ef52ca4f3d5cd9a67717a43d641 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 04:41:41 +0000 Subject: [PATCH 1/2] Bump mypy from 0.961 to 0.971 Bumps [mypy](https://github.com/python/mypy) from 0.961 to 0.971. - [Release notes](https://github.com/python/mypy/releases) - [Commits](https://github.com/python/mypy/compare/v0.961...v0.971) --- updated-dependencies: - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 252f82672..c73c9671a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ flake8==3.9.2 isort==5.10.1 pytest==7.1.2 pytest-mock==3.8.2 -mypy==0.961 +mypy==0.971 types-click==7.1.8 types-pyyaml==6.0.11 trustme==0.9.0 From 3fa11e0f1bca320deaf14533ede302a6bcf3074b Mon Sep 17 00:00:00 2001 From: Marcelo Trylesinski Date: Mon, 1 Aug 2022 10:35:36 +0200 Subject: [PATCH 2/2] Add type ignore on app result --- uvicorn/protocols/http/h11_impl.py | 4 +++- uvicorn/protocols/http/httptools_impl.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/uvicorn/protocols/http/h11_impl.py b/uvicorn/protocols/http/h11_impl.py index 89e550229..905de3de1 100644 --- a/uvicorn/protocols/http/h11_impl.py +++ b/uvicorn/protocols/http/h11_impl.py @@ -400,7 +400,9 @@ def __init__( # ASGI exception wrapper async def run_asgi(self, app: "ASGI3Application") -> None: try: - result = await app(self.scope, self.receive, self.send) + result = await app( # type: ignore[func-returns-value] + self.scope, self.receive, self.send + ) except BaseException as exc: msg = "Exception in ASGI application\n" self.logger.error(msg, exc_info=exc) diff --git a/uvicorn/protocols/http/httptools_impl.py b/uvicorn/protocols/http/httptools_impl.py index d9f294129..715b9e2a0 100644 --- a/uvicorn/protocols/http/httptools_impl.py +++ b/uvicorn/protocols/http/httptools_impl.py @@ -398,7 +398,9 @@ def __init__( # ASGI exception wrapper async def run_asgi(self, app: "ASGI3Application") -> None: try: - result = await app(self.scope, self.receive, self.send) + result = await app( # type: ignore[func-returns-value] + self.scope, self.receive, self.send + ) except BaseException as exc: msg = "Exception in ASGI application\n" self.logger.error(msg, exc_info=exc)