From 9d47c9775198a401d5116483bb46acf5e225e186 Mon Sep 17 00:00:00 2001 From: Irit Katriel Date: Thu, 7 Sep 2023 13:00:49 +0100 Subject: [PATCH] assert in jump tracer and all event in the line tracer --- Lib/test/test_sys_settrace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index 3e3eb632e1040d..a41b845e4de6b6 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -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 @@ -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