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
;; 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