diff options
| author | Glenn Morris | 2013-01-30 09:16:30 -0800 |
|---|---|---|
| committer | Glenn Morris | 2013-01-30 09:16:30 -0800 |
| commit | 741d511359a7862a6f7c65da9e2952a1cc8cd92b (patch) | |
| tree | 82eb14584c41c47800782c2233a3492ce30cf5ce /lisp/progmodes/python.el | |
| parent | 1d4e72256b0e35046a70f561a2da3169872feeb1 (diff) | |
| parent | c491dd7037811c143fd453722c48f81c4fece58a (diff) | |
| download | emacs-741d511359a7862a6f7c65da9e2952a1cc8cd92b.tar.gz emacs-741d511359a7862a6f7c65da9e2952a1cc8cd92b.zip | |
Merge from emacs-24; up to 2012-12-13T00:52:17Z!yamaoka@jpl.org
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index a1322239b35..2cb108cc316 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -2327,15 +2327,17 @@ Argument OUTPUT is a string with the output from the comint process." | |||
| 2327 | (file-name | 2327 | (file-name |
| 2328 | (with-temp-buffer | 2328 | (with-temp-buffer |
| 2329 | (insert full-output) | 2329 | (insert full-output) |
| 2330 | (goto-char (point-min)) | 2330 | ;; When the debugger encounters a pdb.set_trace() |
| 2331 | ;; OK, this sucked but now it became a cool hack. The | 2331 | ;; command, it prints a single stack frame. Sometimes |
| 2332 | ;; stacktrace information normally is on the first line | 2332 | ;; it prints a bit of extra information about the |
| 2333 | ;; but in some cases (like when doing a step-in) it is | 2333 | ;; arguments of the present function. When ipdb |
| 2334 | ;; on the second. | 2334 | ;; encounters an exception, it prints the _entire_ stack |
| 2335 | (when (or (looking-at python-pdbtrack-stacktrace-info-regexp) | 2335 | ;; trace. To handle all of these cases, we want to find |
| 2336 | (and | 2336 | ;; the _last_ stack frame printed in the most recent |
| 2337 | (forward-line) | 2337 | ;; batch of output, then jump to the corrsponding |
| 2338 | (looking-at python-pdbtrack-stacktrace-info-regexp))) | 2338 | ;; file/line number. |
| 2339 | (goto-char (point-max)) | ||
| 2340 | (when (re-search-backward python-pdbtrack-stacktrace-info-regexp nil t) | ||
| 2339 | (setq line-number (string-to-number | 2341 | (setq line-number (string-to-number |
| 2340 | (match-string-no-properties 2))) | 2342 | (match-string-no-properties 2))) |
| 2341 | (match-string-no-properties 1))))) | 2343 | (match-string-no-properties 1))))) |