From f65d6e9d3552cc195aac0527d47fd0ea24ecd662 Mon Sep 17 00:00:00 2001 From: fijal Date: Tue, 30 Jan 2007 17:58:11 +0100 Subject: [PATCH] [svn r37623] Get rid of last frame if possible (the frame containing start_tracing should not be there, unless this is the last frame) --HG-- branch : trunk --- py/apigen/tracer/description.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py/apigen/tracer/description.py b/py/apigen/tracer/description.py index 3a7b677cd..77b4fbf38 100644 --- a/py/apigen/tracer/description.py +++ b/py/apigen/tracer/description.py @@ -78,8 +78,11 @@ def cut_stack(stack, frame, upward_frame=None): if upward_frame: if hasattr(upward_frame, 'raw'): upward_frame = upward_frame.raw - return CallStack([py.code.Frame(i) for i in stack[stack.index(frame):\ - stack.index(upward_frame)+1]]) + lst = [py.code.Frame(i) for i in stack[stack.index(frame):\ + stack.index(upward_frame)+1]] + if len(lst) > 1: + return CallStack(lst[:-1]) + return CallStack(lst) return CallStack([py.code.Frame(i) for i in stack[stack.index(frame):]]) ##class CallSite(object):