From e44970863d763264189e7ab98d6991a38dc95dc9 Mon Sep 17 00:00:00 2001 From: Fabián Ezequiel Gallina Date: Mon, 28 Jan 2013 18:59:42 -0300 Subject: * progmodes/python.el (python-shell-parse-command): Find python-shell-interpreter with modified environment. --- lisp/progmodes/python.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index c321714e2f1..71c5ba57fa0 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1654,7 +1654,11 @@ uniqueness for different types of configurations." (defun python-shell-parse-command () "Calculate the string used to execute the inferior Python process." - (format "%s %s" python-shell-interpreter python-shell-interpreter-args)) + (let ((process-environment (python-shell-calculate-process-environment)) + (exec-path (python-shell-calculate-exec-path))) + (format "%s %s" + (executable-find python-shell-interpreter) + python-shell-interpreter-args))) (defun python-shell-calculate-process-environment () "Calculate process environment given `python-shell-virtualenv-path'." -- cgit v1.2.1 From 6ff930c3d206417e4cec9429fa5d71bb5c9af541 Mon Sep 17 00:00:00 2001 From: Fabián Ezequiel Gallina Date: Wed, 30 Jan 2013 12:02:58 -0300 Subject: * progmodes/python.el (python-pdbtrack-comint-output-filter-function): Enhancements on stacktrace detection. (thanks @gnovak) --- lisp/progmodes/python.el | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 71c5ba57fa0..2a7a3765ac2 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2317,15 +2317,17 @@ Argument OUTPUT is a string with the output from the comint process." (file-name (with-temp-buffer (insert full-output) - (goto-char (point-min)) - ;; OK, this sucked but now it became a cool hack. The - ;; stacktrace information normally is on the first line - ;; but in some cases (like when doing a step-in) it is - ;; on the second. - (when (or (looking-at python-pdbtrack-stacktrace-info-regexp) - (and - (forward-line) - (looking-at python-pdbtrack-stacktrace-info-regexp))) + ;; When the debugger encounters a pdb.set_trace() + ;; command, it prints a single stack frame. Sometimes + ;; it prints a bit of extra information about the + ;; arguments of the present function. When ipdb + ;; encounters an exception, it prints the _entire_ stack + ;; trace. To handle all of these cases, we want to find + ;; the _last_ stack frame printed in the most recent + ;; batch of output, then jump to the corrsponding + ;; file/line number. + (goto-char (point-max)) + (when (re-search-backward python-pdbtrack-stacktrace-info-regexp nil t) (setq line-number (string-to-number (match-string-no-properties 2))) (match-string-no-properties 1))))) -- cgit v1.2.1