mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Upgrade mypy to 0.711, drop no longer needed workarounds (#24998)
https://mypy-lang.blogspot.com/2019/06/mypy-0711-released.html
This commit is contained in:
parent
b274b10f38
commit
e8a5306c23
@ -257,8 +257,7 @@ class ConfigEntry:
|
||||
self.title, self.domain)
|
||||
return False
|
||||
# Handler may be a partial
|
||||
# type ignore: https://github.com/python/typeshed/pull/3077
|
||||
while isinstance(handler, functools.partial): # type: ignore
|
||||
while isinstance(handler, functools.partial):
|
||||
handler = handler.func
|
||||
|
||||
if self.version == handler.VERSION:
|
||||
|
@ -270,9 +270,8 @@ class HomeAssistant:
|
||||
|
||||
# Check for partials to properly determine if coroutine function
|
||||
check_target = target
|
||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
||||
while isinstance(check_target, functools.partial): # type: ignore
|
||||
check_target = check_target.func # type: ignore
|
||||
while isinstance(check_target, functools.partial):
|
||||
check_target = check_target.func
|
||||
|
||||
if asyncio.iscoroutine(check_target):
|
||||
task = self.loop.create_task(target) # type: ignore
|
||||
@ -947,9 +946,8 @@ class Service:
|
||||
self.func = func
|
||||
self.schema = schema
|
||||
# Properly detect wrapped functions
|
||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
||||
while isinstance(func, functools.partial): # type: ignore
|
||||
func = func.func # type: ignore
|
||||
while isinstance(func, functools.partial):
|
||||
func = func.func
|
||||
self.is_callback = is_callback(func)
|
||||
self.is_coroutinefunction = asyncio.iscoroutinefunction(func)
|
||||
|
||||
|
@ -141,9 +141,8 @@ def catch_log_exception(
|
||||
|
||||
# Check for partials to properly determine if coroutine function
|
||||
check_func = func
|
||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
||||
while isinstance(check_func, partial): # type: ignore
|
||||
check_func = check_func.func # type: ignore
|
||||
while isinstance(check_func, partial):
|
||||
check_func = check_func.func
|
||||
|
||||
wrapper_func = None
|
||||
if asyncio.iscoroutinefunction(check_func):
|
||||
|
@ -7,7 +7,7 @@ coveralls==1.2.0
|
||||
flake8-docstrings==1.3.0
|
||||
flake8==3.7.7
|
||||
mock-open==1.3.1
|
||||
mypy==0.710
|
||||
mypy==0.711
|
||||
pydocstyle==3.0.0
|
||||
pylint==2.3.1
|
||||
pytest-aiohttp==0.3.0
|
||||
|
@ -8,7 +8,7 @@ coveralls==1.2.0
|
||||
flake8-docstrings==1.3.0
|
||||
flake8==3.7.7
|
||||
mock-open==1.3.1
|
||||
mypy==0.710
|
||||
mypy==0.711
|
||||
pydocstyle==3.0.0
|
||||
pylint==2.3.1
|
||||
pytest-aiohttp==0.3.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user