lang/python: fix stringp errors when opening REPL
Caused my misuse of if-let* to let-bind dynamic variables. The expanded code doesn't quite work out the way I expected, causing python-shell-interpreter to be nil regardless of which side of the if-else statement ran.
This commit is contained in:
parent
6368ef9ba0
commit
63b195b133
1 changed files with 12 additions and 8 deletions
|
@ -7,16 +7,20 @@
|
||||||
(defun +python/repl ()
|
(defun +python/repl ()
|
||||||
"Open the Python REPL."
|
"Open the Python REPL."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
(unless python-shell-interpreter
|
||||||
|
(user-error "`python-shell-interpreter' isn't set"))
|
||||||
(pop-to-buffer
|
(pop-to-buffer
|
||||||
(process-buffer
|
(process-buffer
|
||||||
(let ((interp python-shell-interpreter)
|
(if-let* ((pipenv (executable-find "pipenv"))
|
||||||
(interp-args python-shell-interpreter-args))
|
(pipenv-project (pipenv-project-p)))
|
||||||
(if-let* ((bin (executable-find "pipenv"))
|
(let ((default-directory pipenv-project)
|
||||||
(default-directory (pipenv-project-p))
|
(python-shell-interpreter-args
|
||||||
(python-shell-interpreter "pipenv")
|
(format "run %s %s"
|
||||||
(python-shell-interpreter-args (format "run %s %s" interp interp-args)))
|
python-shell-interpreter
|
||||||
(run-python nil t t)
|
python-shell-interpreter-args))
|
||||||
(run-python nil t t))))))
|
(python-shell-interpreter pipenv))
|
||||||
|
(run-python nil t t))
|
||||||
|
(run-python nil t t)))))
|
||||||
|
|
||||||
(defun +python--extract-version (prefix str)
|
(defun +python--extract-version (prefix str)
|
||||||
(when str
|
(when str
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue