How to use sys.exc_info()???
Roy Smith
roy at panix.com
Wed Oct 18 15:10:21 EDT 2000
I'm stuped with how sys.exc_info() is supposed to work. If I do:
open ('xxx')
I get:
Traceback (innermost last):
File "<stdin>", line 1, in ?
IOError: [Errno 2] No such file or directory: 'xxx'
Which is what I expect. But when I do:
try:
open ('xxx')
except:
foo = sys.exc_info()
What I end up with in foo is
(<class exceptions.IOError at 80a7e20>, <exceptions.IOError instance at 80c82d0>, <traceback object at 80c92c8>)
What I don't understand is how to go from the 3-tuple I get back from
exc_info() to the string "No such file or directory"?
More information about the Python-list
mailing list