Hide irrelevant frames with fast tracer
@@ -917,7 +917,7 @@ class VM:
def is_doing_io(self):
return self._io_level > 0
- def _export_stack(self, newest_frame):
+ def _export_stack(self, newest_frame, skip_checker=None):
result = []
system_frame = newest_frame
@@ -926,6 +926,7 @@ class VM:
module_name = system_frame.f_globals["__name__"]
code_name = system_frame.f_code.co_name
+ if not skip_checker or not skip_checker(system_frame):
source, firstlineno, in_library = self._get_frame_source_info(system_frame)
result.insert(
@@ -1395,7 +1396,7 @@ class FastTracer(Tracer):
def _report_current_state(self, frame):
msg = DebuggerResponse(
- stack=self._vm._export_stack(frame),
+ stack=self._vm._export_stack(frame, self._should_skip_frame),
in_present=True,
io_symbol_count=None,
exception_info=self._export_exception_info(),
@@ -1487,8 +1488,8 @@ class NiceTracer(Tracer):
def _should_skip_frame(self, frame):
code = frame.f_code
return (
- code.co_name
- not in self.marker_function_names # never skip marker functions
+ # never skip marker functions
+ code.co_name not in self.marker_function_names
and (
super()._should_skip_frame(frame)
or code.co_filename not in self._instrumented_files
