mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +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)
|
self.title, self.domain)
|
||||||
return False
|
return False
|
||||||
# Handler may be a partial
|
# Handler may be a partial
|
||||||
# type ignore: https://github.com/python/typeshed/pull/3077
|
while isinstance(handler, functools.partial):
|
||||||
while isinstance(handler, functools.partial): # type: ignore
|
|
||||||
handler = handler.func
|
handler = handler.func
|
||||||
|
|
||||||
if self.version == handler.VERSION:
|
if self.version == handler.VERSION:
|
||||||
|
@ -270,9 +270,8 @@ class HomeAssistant:
|
|||||||
|
|
||||||
# Check for partials to properly determine if coroutine function
|
# Check for partials to properly determine if coroutine function
|
||||||
check_target = target
|
check_target = target
|
||||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
while isinstance(check_target, functools.partial):
|
||||||
while isinstance(check_target, functools.partial): # type: ignore
|
check_target = check_target.func
|
||||||
check_target = check_target.func # type: ignore
|
|
||||||
|
|
||||||
if asyncio.iscoroutine(check_target):
|
if asyncio.iscoroutine(check_target):
|
||||||
task = self.loop.create_task(target) # type: ignore
|
task = self.loop.create_task(target) # type: ignore
|
||||||
@ -947,9 +946,8 @@ class Service:
|
|||||||
self.func = func
|
self.func = func
|
||||||
self.schema = schema
|
self.schema = schema
|
||||||
# Properly detect wrapped functions
|
# Properly detect wrapped functions
|
||||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
while isinstance(func, functools.partial):
|
||||||
while isinstance(func, functools.partial): # type: ignore
|
func = func.func
|
||||||
func = func.func # type: ignore
|
|
||||||
self.is_callback = is_callback(func)
|
self.is_callback = is_callback(func)
|
||||||
self.is_coroutinefunction = asyncio.iscoroutinefunction(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 for partials to properly determine if coroutine function
|
||||||
check_func = func
|
check_func = func
|
||||||
# type ignores: https://github.com/python/typeshed/pull/3077
|
while isinstance(check_func, partial):
|
||||||
while isinstance(check_func, partial): # type: ignore
|
check_func = check_func.func
|
||||||
check_func = check_func.func # type: ignore
|
|
||||||
|
|
||||||
wrapper_func = None
|
wrapper_func = None
|
||||||
if asyncio.iscoroutinefunction(check_func):
|
if asyncio.iscoroutinefunction(check_func):
|
||||||
|
@ -7,7 +7,7 @@ coveralls==1.2.0
|
|||||||
flake8-docstrings==1.3.0
|
flake8-docstrings==1.3.0
|
||||||
flake8==3.7.7
|
flake8==3.7.7
|
||||||
mock-open==1.3.1
|
mock-open==1.3.1
|
||||||
mypy==0.710
|
mypy==0.711
|
||||||
pydocstyle==3.0.0
|
pydocstyle==3.0.0
|
||||||
pylint==2.3.1
|
pylint==2.3.1
|
||||||
pytest-aiohttp==0.3.0
|
pytest-aiohttp==0.3.0
|
||||||
|
@ -8,7 +8,7 @@ coveralls==1.2.0
|
|||||||
flake8-docstrings==1.3.0
|
flake8-docstrings==1.3.0
|
||||||
flake8==3.7.7
|
flake8==3.7.7
|
||||||
mock-open==1.3.1
|
mock-open==1.3.1
|
||||||
mypy==0.710
|
mypy==0.711
|
||||||
pydocstyle==3.0.0
|
pydocstyle==3.0.0
|
||||||
pylint==2.3.1
|
pylint==2.3.1
|
||||||
pytest-aiohttp==0.3.0
|
pytest-aiohttp==0.3.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user