Bump mypy from 0.910 to 0.961 (#2269)

* Bump mypy from 0.910 to 0.961

Bumps [mypy](https://github.com/python/mypy) from 0.910 to 0.961.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](https://github.com/python/mypy/compare/v0.910...v0.961)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Handle py37 iscoroutine type guard oddity

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: florimondmanca <florimond.manca@protonmail.com>
This commit is contained in:
dependabot[bot] 2022-06-19 12:50:04 +02:00 committed by GitHub
parent 132ccd9834
commit 344e01e98a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -2,8 +2,13 @@
The _compat module is used for code which requires branching between different
Python environments. It is excluded from the code coverage checks.
"""
import asyncio
import ssl
import sys
import typing
if typing.TYPE_CHECKING: # pragma: no cover
import typing_extensions
# Brotli support is optional
# The C bindings in `brotli` are recommended for CPython.
@ -38,3 +43,8 @@ else:
context.options |= ssl.OP_NO_SSLv3
context.options |= ssl.OP_NO_TLSv1
context.options |= ssl.OP_NO_TLSv1_1
def iscoroutine(coro: object) -> "typing_extensions.TypeGuard[typing.Coroutine]":
# Drop when this is resolved: https://github.com/python/typeshed/pull/8104
return asyncio.iscoroutine(coro)

View File

@ -1,6 +1,6 @@
import asyncio
import typing
from .._compat import iscoroutine
from .._models import Request, Response
from .base import AsyncBaseTransport, BaseTransport
@ -28,7 +28,7 @@ class MockTransport(AsyncBaseTransport, BaseTransport):
# return the result.
# https://simonwillison.net/2020/Sep/2/await-me-maybe/
if asyncio.iscoroutine(response):
if iscoroutine(response):
response = await response
return response

View File

@ -27,7 +27,7 @@ flake8==3.9.2
flake8-bugbear==22.4.25
flake8-pie==0.15.0; python_version>='3.7'
isort==5.10.1
mypy==0.910
mypy==0.961
types-certifi==2021.10.8.2
pytest==7.1.2
pytest-asyncio==0.18.3