Skip to content

Commit 875668c

Browse files
cocolatojohnslavik
andauthored
Update Lib/pdb.py
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent 5bc3037 commit 875668c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Lib/pdb.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,12 +1315,14 @@ def do_commands(self, arg):
13151315
reached.
13161316
"""
13171317
if not arg:
1318-
for bnum in range(len(bdb.Breakpoint.bpbynumber) - 1, -1, -1):
1319-
if bdb.Breakpoint.bpbynumber[bnum] is not None:
1320-
break
1321-
if bnum == 0:
1322-
self.error('no breakpoints set')
1323-
return
1318+
for bp in reversed(bdb.Breakpoint.bpbynumber):
1319+
if not bp:
1320+
continue
1321+
bnum = bp.number
1322+
break
1323+
else:
1324+
self.error('no breakpoints set')
1325+
return
13241326
else:
13251327
try:
13261328
bnum = int(arg)

0 commit comments

Comments
 (0)