From e5006d9a193f357203b3e99d41f66b76de2fc2b6 Mon Sep 17 00:00:00 2001 From: dynobo Date: Sat, 20 Apr 2024 23:35:33 +0200 Subject: [PATCH] chore: fix linter finding --- keyhint/context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keyhint/context.py b/keyhint/context.py index 34cad62..ff31b24 100644 --- a/keyhint/context.py +++ b/keyhint/context.py @@ -6,6 +6,7 @@ import re import shutil import subprocess +import sys import traceback logger = logging.getLogger("keyhint") @@ -202,7 +203,7 @@ def detect_active_window() -> tuple[str, str]: wm_class, window_title = get_active_window_info_x() except Exception: traceback.print_stack() - logger.error( + logger.error( # noqa: TRY400 # the stacktrace should be before message "Couldn't detect active application window.\n" "KeyHint supports Wayland and Xorg.\n" "For Wayland, the installation of the 'Window Calls' gnome extension is " @@ -212,7 +213,7 @@ def detect_active_window() -> tuple[str, str]: "If you met the prerequisites but still see this, please create an issue " "incl. the traceback above on:\nhttps://github.com/dynobo/keyhint/issues" ) - exit(1) + sys.exit(1) logger.debug("Detected wm_class: '%s'.", wm_class) logger.debug("Detected window_title: '%s'.", window_title)