Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion python/probing/inspect/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,12 @@ def wrapper(*args, **kwargs):
raise RuntimeError(f"Probe attributes not found for code id {code_id}")

ProbingTracer = getattr(_trace_module, "ProbingTracer")
# Handle None depth value - use default of 1 if None
probe_depth = attrs.get("__probe_depth__", 1)
if probe_depth is None:
probe_depth = 1
tracer = ProbingTracer(
attrs.get("__probe_depth__", 1),
probe_depth,
attrs.get("__probe_watch__", []),
attrs.get("__probe_silent_watch__", []),
)
Expand Down Expand Up @@ -678,6 +682,9 @@ def on_return(self):

def _outof_depth(self):
depth = self.count_calls - self.count_returns
# If self.depth is None, it means no depth limit, so we're never out of depth
if self.depth is None:
return False
return depth > self.depth

def _is_internal_frame(self, frame):
Expand Down