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:
parent
77654da341
commit
fde128d66c
11 changed files with 25 additions and 19 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue