refactor(python): string= first, then executable-find

The latter is a little slower depending on the order of $PATH.
This commit is contained in:
Henrik Lissner
2025-08-31 09:50:05 +02:00
parent 2e508c299d
commit 83eba01bff

View File

@@ -58,8 +58,8 @@
;; Default to Python 3. Prefer the versioned Python binaries since some ;; Default to Python 3. Prefer the versioned Python binaries since some
;; systems link the unversioned one to Python 2. ;; systems link the unversioned one to Python 2.
(when (and (executable-find "python3") (when (and (string= python-shell-interpreter "python") ; only if unmodified
(string= python-shell-interpreter "python")) (executable-find "python3"))
(setq python-shell-interpreter "python3")) (setq python-shell-interpreter "python3"))
(add-hook! 'python-mode-hook (add-hook! 'python-mode-hook