Skip to content

Commit

Permalink
Avoid setting frame when walking to determine whether we're above bot…
Browse files Browse the repository at this point in the history
…tom frame
  • Loading branch information
inducer committed May 21, 2022
1 parent 98ccafc commit 273b2f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pudb/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,13 @@ def interaction(self, frame, exc_tuple=None, show_exc_dialog=True):
else:
tb = exc_tuple[2]

if frame is None and tb is not None:
frame = tb.tb_frame
if frame is None:
assert tb is not None
walk_frame = tb.tb_frame
else:
walk_frame = frame

found_bottom_frame = False
walk_frame = frame
while True:
if walk_frame is self.bottom_frame:
found_bottom_frame = True
Expand All @@ -411,6 +413,7 @@ def interaction(self, frame, exc_tuple=None, show_exc_dialog=True):
walk_frame = walk_frame.f_back

if not found_bottom_frame and not self.post_mortem:
# We aren't supposed to be debugging this.
return

self.stack, index = self.get_shortened_stack(frame, tb)
Expand Down

0 comments on commit 273b2f1

Please sign in to comment.