aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el20
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)))))