code: 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 framef 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
docs: unwind traceback tb_next structure to array