summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-10-22 21:19:41 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-10-22 21:19:41 (GMT)
commitaf956f1d4805e7a78bca211cb8246661edcba535 (patch)
tree78ee72cfb26908971ae3da3321dd745b78d109e9 /Lib
parent3e80861cb7fdde8885196a0883ff6aa6e4ba5ccb (diff)
downloadcpython-af956f1d4805e7a78bca211cb8246661edcba535.zip
cpython-af956f1d4805e7a78bca211cb8246661edcba535.tar.gz
cpython-af956f1d4805e7a78bca211cb8246661edcba535.tar.bz2
Merged revisions 67000 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67000 | benjamin.peterson | 2008-10-22 16:16:34 -0500 (Wed, 22 Oct 2008) | 1 line fix #4150: pdb's up command didn't work for generators in post-mortem ........
Diffstat (limited to 'Lib')
-rw-r--r--Lib/bdb.py2
-rwxr-xr-xLib/pdb.py8
2 files changed, 4 insertions, 6 deletions
diff --git a/Lib/bdb.py b/Lib/bdb.py
index d74415b..5288cc0 100644
--- a/Lib/bdb.py
+++ b/Lib/bdb.py
@@ -320,6 +320,8 @@ class Bdb:
while t is not None:
stack.append((t.tb_frame, t.tb_lineno))
t = t.tb_next
+ if f is None:
+ i = max(0, len(stack) - 1)
return stack, i
#
diff --git a/Lib/pdb.py b/Lib/pdb.py
index a7a3a18..4a080c7 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1224,9 +1224,7 @@ def post_mortem(t=None):
p = Pdb()
p.reset()
- while t.tb_next is not None:
- t = t.tb_next
- p.interaction(t.tb_frame, t)
+ p.interaction(None, t)
def pm():
post_mortem(sys.last_traceback)
@@ -1289,9 +1287,7 @@ def main():
print "Uncaught exception. Entering post mortem debugging"
print "Running 'cont' or 'step' will restart the program"
t = sys.exc_info()[2]
- while t.tb_next is not None:
- t = t.tb_next
- pdb.interaction(t.tb_frame,t)
+ pdb.interaction(None, t)
print "Post mortem debugger finished. The "+mainpyfile+" will be restarted"