Update mypy to a custom version (#111258)

* Update mypy to a custom version

* Fix call_soon_threadsafe typing

Result from a recent typeshed change -> better asyncio callback typing with Ts
This commit is contained in:
Marc Mueller 2024-03-01 13:31:28 +01:00 committed by GitHub
parent 841d4e320f
commit f0be33fc6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -513,6 +513,11 @@ class HomeAssistant:
"""
if target is None:
raise ValueError("Don't call add_job with None")
if asyncio.iscoroutine(target):
self.loop.call_soon_threadsafe(self.async_add_job, target)
return
if TYPE_CHECKING:
target = cast(Callable[..., Any], target)
self.loop.call_soon_threadsafe(self.async_add_job, target, *args)
@overload

View File

@ -11,7 +11,7 @@ astroid==3.1.0
coverage==7.4.3
freezegun==1.4.0
mock-open==1.4.0
mypy==1.8.0
mypy-dev==1.9.0b1
pre-commit==3.6.2
pydantic==1.10.12
pylint==3.1.0