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:
Ville Skyttä 2019-09-27 22:57:59 +03:00 committed by GitHub
parent 77654da341
commit fde128d66c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 19 deletions

View file

@ -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)