Steve Holden wrote:

> import xml.parsers.expat


Thanks, that worked.


>
> def r():
>    return 1/0
>
> try:
>    print r()
> except:
>    import sys
>    t, v, tb = sys.exc_info()
>
> print "exception on line", tb.tb_lineno

How do I get the helpful text that is thrown with the exception? Like
if the exception is " IOError: [Errno 2] No such file or directory:
'out.xml' "

How do I get the the text after IOError: ?

Thanks again.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to