From 5861da6d3b8ffc7feebb2bb029b31c4d29da126d Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Thu, 26 Sep 2024 17:11:56 +0200 Subject: [PATCH] Prefer python3 for python-interpreter * lisp/progmodes/python.el (python-interpreter): Prefer "python3" when it exists, to be consistent with python-shell-interpreter. (cherry picked from commit 7f0a252f2160dd4d168bc77e2f6e6c9901b67465) --- lisp/progmodes/python.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 0ee14cbea45..da1cf1150d3 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -312,14 +312,17 @@ :version "24.3" :link '(emacs-commentary-link "python")) -(defcustom python-interpreter "python" +(defcustom python-interpreter + (cond ((executable-find "python3") "python3") + ((executable-find "python") "python") + (t "python3")) "Python interpreter for noninteractive use. Some Python interpreters also require changes to `python-interpreter-args'. To customize the Python interpreter for interactive use, modify `python-shell-interpreter' instead." - :version "29.1" + :version "30.1" :type 'string) (defcustom python-interpreter-args "" -- 2.39.5