unwind traceback tb_next structure to array

def tbframes(tb):
  'unwind traceback tb_next structure to array'
  frames=[tb.tb_frame]
  while tb.tb_next: tb=tb.tb_next; frames.append(tb.tb_frame)
  return frames