]> code.delx.au - gnu-emacs/commitdiff
python.el: Fix prompt detection with user overridden interpreter
authorFabián Ezequiel Gallina <fgallina@gnu.org>
Sun, 23 Aug 2015 16:58:17 +0000 (13:58 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Sun, 23 Aug 2015 16:59:48 +0000 (13:59 -0300)
* lisp/progmodes/python.el (python-shell-prompt-detect): Honor
buffer local python-shell-interpreter and
python-shell-interpreter-interactive-arg.

lisp/progmodes/python.el

index 3bfc5cf4b6fb81fbf6113c431a953b41eec213f4..426b465f7451d3b3591ed85260bf9c172a23139c 100644 (file)
@@ -2200,6 +2200,8 @@ detection and just returns nil."
                     "ps_json = '\\n[\"%s\", \"%s\", \"%s\"]\\n' % tuple(ps)\n"
                     "print (ps_json)\n"
                     "sys.exit(0)\n"))
+             (interpreter python-shell-interpreter)
+             (interpreter-arg python-shell-interpreter-interactive-arg)
              (output
               (with-temp-buffer
                 ;; TODO: improve error handling by using
@@ -2209,11 +2211,11 @@ detection and just returns nil."
                   (let ((code-file (python-shell--save-temp-file code)))
                     ;; Use `process-file' as it is remote-host friendly.
                     (process-file
-                     python-shell-interpreter
+                     interpreter
                      code-file
                      '(t nil)
                      nil
-                     python-shell-interpreter-interactive-arg)
+                     interpreter-arg)
                     ;; Try to cleanup
                     (delete-file code-file)))
                 (buffer-string)))