Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* layers/+lang/python/funcs.el: Remove obsolated code #16383

Merged
merged 1 commit into from
May 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 6 additions & 16 deletions layers/+lang/python/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -508,22 +508,12 @@ If region is not active then send line."
(defun spacemacs/python-start-or-switch-repl ()
"Start and/or switch to the REPL."
(interactive)
(let ((shell-process
(or (python-shell-get-process)
;; `run-python' has different return values and different
;; errors in different emacs versions. In 24.4, it throws an
;; error when the process didn't start, but in 25.1 it
;; doesn't throw an error, so we demote errors here and
;; check the process later
(with-demoted-errors "Error: %S"
;; in Emacs 24.5 and 24.4, `run-python' doesn't return the
;; shell process
(call-interactively #'run-python)
(python-shell-get-process)))))
(unless shell-process
(error "Failed to start python shell properly"))
(pop-to-buffer (process-buffer shell-process))
(evil-insert-state)))
(if-let ((shell-process (or (python-shell-get-process)
(call-interactively #'run-python))))
(progn
(pop-to-buffer (process-buffer shell-process))
(evil-insert-state))
(error "Failed to start python shell properly")))

(defun spacemacs/python-execute-file (arg)
"Execute a python script in a shell."
Expand Down