Skip to content

Commit

Permalink
assert in jump tracer and all event in the line tracer
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Sep 7, 2023
1 parent fd1bc94 commit 9d47c97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_sys_settrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,7 @@ def _reconfigure_frame(self, frame):
frame.f_trace_opcodes = self.trace_opcode_events

def trace(self, frame, event, arg):
if event == 'line':
assert lineno_matches_lasti(frame)
assert lineno_matches_lasti(frame)
self._reconfigure_frame(frame)
self.events.append((frame.f_lineno, event))
return self.trace
Expand Down Expand Up @@ -1886,6 +1885,7 @@ def __init__(self, function, jumpFrom, jumpTo, event='line',
def trace(self, frame, event, arg):
if self.done:
return
assert lineno_matches_lasti(frame)
# frame.f_code.co_firstlineno is the first line of the decorator when
# 'function' is decorated and the decorator may be written using
# multiple physical lines when it is too long. Use the first line
Expand Down

0 comments on commit 9d47c97

Please sign in to comment.