Upgrade mypy to 0.710 (#24666)
* Upgrade mypy to 0.710 * Address mypy 0.710 errors
This commit is contained in:
1 parent
f189367c02
commit
a6eef22fbc
8 files changed
+18
-14
No files matched your search
@@ -270,8 +270,9 @@ class HomeAssistant:
|
||||
|
||||
# Check for partials to properly determine if coroutine function
|
||||
check_target = target
|
||||
while isinstance(check_target, functools.partial):
|
||||
check_target = check_target.func
|
||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
||||
while isinstance(check_target, functools.partial): # type: ignore
|
||||
check_target = check_target.func # type: ignore
|
||||
|
||||
if asyncio.iscoroutine(check_target):
|
||||
task = self.loop.create_task(target) # type: ignore
|
||||
@@ -946,8 +947,9 @@ class Service:
|
||||
self.func = func
|
||||
self.schema = schema
|
||||
# Properly detect wrapped functions
|
||||
while isinstance(func, functools.partial):
|
||||
func = func.func
|
||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
||||
while isinstance(func, functools.partial): # type: ignore
|
||||
func = func.func # type: ignore
|
||||
self.is_callback = is_callback(func)
|
||||
self.is_coroutinefunction = asyncio.iscoroutinefunction(func)
|
||||
|
||||
|
||||
Reference in new issue
Block a user