Skip to content

Commit

Permalink
[python] Fix wrongly setting interpreter to nil (#16837)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcc32 authored Feb 23, 2025
1 parent 3eb417e commit 4216cbb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions layers/+lang/python/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ compatibility."
ROOT-DIR should be the directory path for the environment, `nil' for clean up."
(when (or (not (bound-and-true-p python-shell-interpreter))
(equal python-shell-interpreter spacemacs--python-shell-interpreter-origin))
(if-let* ((default-directory root-dir)
(pyshell (or (spacemacs/pyenv-executable-find
'("ipython3" "ipython" "python3" "python2" "python"))
"python3"))
(ipythonp (string-search "ipython" (file-name-nondirectory pyshell))))
(setq-local python-shell-interpreter pyshell
python-shell-interpreter-args (if ipythonp "-i --simple-prompt" "-i"))
(if-let* ((default-directory root-dir))
(let* ((pyshell (or (spacemacs/pyenv-executable-find
'("ipython3" "ipython" "python3" "python2" "python"))
"python3"))
(ipythonp (string-search "ipython" (file-name-nondirectory pyshell))))
(setq-local python-shell-interpreter pyshell
python-shell-interpreter-args (if ipythonp "-i --simple-prompt" "-i")))
;; args is nil, clean up the variables
(setq-local python-shell-interpreter nil
python-shell-interpreter-args nil))))
Expand Down

0 comments on commit 4216cbb

Please sign in to comment.