Skip to content

Commit 6ad8598

Browse files
Rename the variable and update the comments
1 parent 99837fd commit 6ad8598

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

Lib/bdb.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,10 @@ def dispatch_line(self, frame):
307307
Return self.trace_dispatch to continue tracing in this scope.
308308
"""
309309
# GH-136057
310-
# For line events, besides whether we should stop at the frame, we
311-
# also need to check if it's the same line as we issue the command.
310+
# For line events, we don't want to stop at the same line where
311+
# we issue the previous next/step command.
312312
if (self.stop_here(frame) or self.break_here(frame)) and not (
313-
self.startframe == frame and self.startlineno == frame.f_lineno
313+
self.cmdframe == frame and self.cmdlineno == frame.f_lineno
314314
):
315315
self.user_line(frame)
316316
self.restart_events()
@@ -541,7 +541,7 @@ def _set_trace_opcodes(self, trace_opcodes):
541541
self.monitoring_tracer.update_local_events()
542542

543543
def _set_stopinfo(self, stopframe, returnframe, stoplineno=0, opcode=False,
544-
startframe=None, startlineno=None):
544+
cmdframe=None, cmdlineno=None):
545545
"""Set the attributes for stopping.
546546
547547
If stoplineno is greater than or equal to 0, then stop at line
@@ -554,10 +554,11 @@ def _set_stopinfo(self, stopframe, returnframe, stoplineno=0, opcode=False,
554554
# stoplineno >= 0 means: stop at line >= the stoplineno
555555
# stoplineno -1 means: don't stop at all
556556
self.stoplineno = stoplineno
557-
# startframe/startlineno is the frame/line number when the user does
558-
# step or next. We don't want to stop at the same line for those commands.
559-
self.startframe = startframe
560-
self.startlineno = startlineno
557+
# cmdframe/cmdlineno is the frame/line number when the user issue
558+
# step/next commands. We don't want to stop at the same line for
559+
# those commands.
560+
self.cmdframe = cmdframe
561+
self.cmdlineno = cmdlineno
561562
self._set_trace_opcodes(opcode)
562563

563564
def _set_caller_tracefunc(self, current_frame):
@@ -584,16 +585,16 @@ def set_until(self, frame, lineno=None):
584585
def set_step(self):
585586
"""Stop after one line of code."""
586587
# set_step() could be called from signal handler so enterframe might be None
587-
self._set_stopinfo(None, None, startframe=self.enterframe,
588-
startlineno=getattr(self.enterframe, 'f_lineno', None))
588+
self._set_stopinfo(None, None, cmdframe=self.enterframe,
589+
cmdlineno=getattr(self.enterframe, 'f_lineno', None))
589590

590591
def set_stepinstr(self):
591592
"""Stop before the next instruction."""
592593
self._set_stopinfo(None, None, opcode=True)
593594

594595
def set_next(self, frame):
595596
"""Stop on the next line in or below the given frame."""
596-
self._set_stopinfo(frame, None, startframe=frame, startlineno=frame.f_lineno)
597+
self._set_stopinfo(frame, None, cmdframe=frame, cmdlineno=frame.f_lineno)
597598

598599
def set_return(self, frame):
599600
"""Stop when returning from the given frame."""

0 commit comments

Comments
 (0)