returning traceback strings
holger krekel
pyth at devel.trillke.net
Thu Jun 13 19:25:42 EDT 2002
Chris Liechti wrote:
> Matthew Boedicker <mboedick at mboedick.org> wrote in
> >
> > This is the best workaround I was able to come up with:
> >
> > import cStringIO
> > import traceback
> >
> > def print_exc_str():
> > buf = cStringIO.StringIO()
> > traceback.print_exc(file=buf)
> > return buf.getvalue()
>
> try that:
> ''.join(traceback.format_exception(*sys.exc_info()))
yeah. why not take the easy road :-)
holger
More information about the Python-list
mailing list