From: Stefan Kangas Date: Thu, 26 Sep 2024 15:11:56 +0000 (+0200) Subject: Prefer python3 for python-interpreter X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5861da6d3b8ffc7feebb2bb029b31c4d29da126d;p=emacs.git 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) --- 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 ""