'Return the same data as from traceback.format_exception.'

def format_exception(self):

    import traceback
    frames = self.get_traceback_frames()
    tb = [(f[u'filename'], f[u'lineno'], f[u'function'], f[u'context_line']) for f in frames]
    list = [u'Traceback    (most    recent    call    last):\n']
    list += traceback.format_list(tb)
    list += traceback.format_exception_only(self.exc_type, self.exc_value)
    return list
