From db2e2e6e5d249df984bd93de3a4184936953abfa Mon Sep 17 00:00:00 2001 From: Roman Miroshnychenko Date: Sun, 7 Apr 2024 12:58:13 +0300 Subject: [PATCH] Fix linter errors --- plugin.video.external.library/commands.py | 3 ++- plugin.video.external.library/libs/exception_logger.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin.video.external.library/commands.py b/plugin.video.external.library/commands.py index d3163db..acede45 100644 --- a/plugin.video.external.library/commands.py +++ b/plugin.video.external.library/commands.py @@ -12,7 +12,7 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +import logging import sys import xbmc @@ -23,6 +23,7 @@ from libs.kodi_service import GettextEmulator, initialize_logging initialize_logging() +logger = logging.getLogger(__name__) _ = GettextEmulator.gettext diff --git a/plugin.video.external.library/libs/exception_logger.py b/plugin.video.external.library/libs/exception_logger.py index 36e40d3..5743ffd 100644 --- a/plugin.video.external.library/libs/exception_logger.py +++ b/plugin.video.external.library/libs/exception_logger.py @@ -155,7 +155,9 @@ def format_exception(exc_obj: Optional[Exception] = None) -> str: @contextmanager -def catch_exception(logger_func: Callable[[str], None] = logger.error) -> Generator[None, None, None]: +def catch_exception( + logger_func: Callable[[str], None] = logger.error +) -> Generator[None, None, None]: """ Diagnostic helper context manager @@ -186,7 +188,7 @@ def catch_exception(logger_func: Callable[[str], None] = logger.error) -> Genera try: yield except Exception as exc: - message = format_exception(exc) + message = format_exception(exc) # pylint: disable=logging-not-lazy # pylint: disable=line-too-long logger_func('\n*********************************** Unhandled exception detected ***********************************\n' + message)