From db04c70d4a81681da33c68ba8fffbc8fce79987f Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 31 Jul 2020 15:39:56 +0200 Subject: [PATCH] Let kitty_exe() raise an error message if kitty could not be found --- kitty/constants.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kitty/constants.py b/kitty/constants.py index 62d9262a1..3d52a58d5 100644 --- a/kitty/constants.py +++ b/kitty/constants.py @@ -64,16 +64,16 @@ class WindowGeometry(NamedTuple): def kitty_exe() -> str: rpath = sys._xoptions.get('bundle_exe_dir') if not rpath: - items = filter(None, os.environ.get('PATH', '').split(os.pathsep)) + items = os.environ.get('PATH', '').split(os.pathsep) + [os.path.join(base, 'launcher')] seen: Set[str] = set() - for candidate in items: + for candidate in filter(None, items): if candidate not in seen: seen.add(candidate) if os.access(os.path.join(candidate, 'kitty'), os.X_OK): rpath = candidate break else: - rpath = os.path.join(base, 'launcher') + raise SystemExit('kitty binary not found') return os.path.join(rpath, 'kitty')