[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
This commit is contained in:
fijal 2007-01-30 17:58:11 +01:00
parent d80bbf4a68
commit f65d6e9d35
1 changed files with 5 additions and 2 deletions

View File

@ -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):