[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master fa686f0: Default python-shell-interpreter to python3

From: Lars Ingebrigtsen
Subject: master fa686f0: Default python-shell-interpreter to python3
Date: Sun, 10 Jan 2021 09:49:07 -0500 (EST)

branch: master
commit fa686f099800aac22dcdc39fb84ee2dcca8ffbf4
Author: Glenn Morris <rgm@gnu.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Default python-shell-interpreter to python3
    * lisp/progmodes/python.el (python-shell-interpreter): Default to
    python3 (bug#45655).
 etc/NEWS                 | 2 ++
 lisp/progmodes/python.el | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index d655955..13ef7d8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -347,6 +347,8 @@ is set to nil, this message is inhibited.
 ** Python mode
+*** 'python-shell-interpreter' now defaults to python3 on systems with python3.
 *** 'C-c C-r' can now be used on arbitrary regions.
 The command previously extended the start of the region to the start
 of the line, but will now actually send the marked region, as
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 0965fec..d6c0a4d 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2027,8 +2027,12 @@ position, else returns nil."
   :group 'python
   :safe 'stringp)
-(defcustom python-shell-interpreter "python"
+(defcustom python-shell-interpreter
+  (cond ((executable-find "python3") "python3")
+        ((executable-find "python") "python")
+        (t "python3"))
   "Default Python interpreter for shell."
+  :version "28.1"
   :type 'string
   :group 'python)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]