mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Upgrade mypy to 0.730, address raised issues (#26959)
https://mypy-lang.blogspot.com/2019/09/mypy-730-released.html
This commit is contained in:
@@ -130,7 +130,7 @@ def catch_log_exception(
|
||||
"""Decorate a callback to catch and log exceptions."""
|
||||
|
||||
def log_exception(*args: Any) -> None:
|
||||
module_name = inspect.getmodule(inspect.trace()[1][0]).__name__
|
||||
module_name = inspect.getmodule(inspect.trace()[1][0]).__name__ # type: ignore
|
||||
# Do not print the wrapper in the traceback
|
||||
frames = len(inspect.trace()) - 1
|
||||
exc_msg = traceback.format_exc(-frames)
|
||||
@@ -178,7 +178,9 @@ def catch_log_coro_exception(
|
||||
try:
|
||||
return await target
|
||||
except Exception: # pylint: disable=broad-except
|
||||
module_name = inspect.getmodule(inspect.trace()[1][0]).__name__
|
||||
module_name = inspect.getmodule( # type: ignore
|
||||
inspect.trace()[1][0]
|
||||
).__name__
|
||||
# Do not print the wrapper in the traceback
|
||||
frames = len(inspect.trace()) - 1
|
||||
exc_msg = traceback.format_exc(-frames)
|
||||
|
||||
Reference in New Issue
Block a user