diff options
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 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." | |||
| 2317 | (file-name | 2317 | (file-name |
| 2318 | (with-temp-buffer | 2318 | (with-temp-buffer |
| 2319 | (insert full-output) | 2319 | (insert full-output) |
| 2320 | (goto-char (point-min)) | 2320 | ;; When the debugger encounters a pdb.set_trace() |
| 2321 | ;; OK, this sucked but now it became a cool hack. The | 2321 | ;; command, it prints a single stack frame. Sometimes |
| 2322 | ;; stacktrace information normally is on the first line | 2322 | ;; it prints a bit of extra information about the |
| 2323 | ;; but in some cases (like when doing a step-in) it is | 2323 | ;; arguments of the present function. When ipdb |
| 2324 | ;; on the second. | 2324 | ;; encounters an exception, it prints the _entire_ stack |
| 2325 | (when (or (looking-at python-pdbtrack-stacktrace-info-regexp) | 2325 | ;; trace. To handle all of these cases, we want to find |
| 2326 | (and | 2326 | ;; the _last_ stack frame printed in the most recent |
| 2327 | (forward-line) | 2327 | ;; batch of output, then jump to the corrsponding |
| 2328 | (looking-at python-pdbtrack-stacktrace-info-regexp))) | 2328 | ;; file/line number. |
| 2329 | (goto-char (point-max)) | ||
| 2330 | (when (re-search-backward python-pdbtrack-stacktrace-info-regexp nil t) | ||
| 2329 | (setq line-number (string-to-number | 2331 | (setq line-number (string-to-number |
| 2330 | (match-string-no-properties 2))) | 2332 | (match-string-no-properties 2))) |
| 2331 | (match-string-no-properties 1))))) | 2333 | (match-string-no-properties 1))))) |