From 83eba01bff4195e01703ec3ab0414a117e6fc141 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 31 Aug 2025 09:50:05 +0200 Subject: [PATCH] refactor(python): string= first, then executable-find The latter is a little slower depending on the order of $PATH. --- modules/lang/python/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index cac6d80c1..1cbb9f529 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -58,8 +58,8 @@ ;; Default to Python 3. Prefer the versioned Python binaries since some ;; systems link the unversioned one to Python 2. - (when (and (executable-find "python3") - (string= python-shell-interpreter "python")) + (when (and (string= python-shell-interpreter "python") ; only if unmodified + (executable-find "python3")) (setq python-shell-interpreter "python3")) (add-hook! 'python-mode-hook