Catch unknown exception

Roy Smith roy at
Fri Oct 29 15:21:50 CEST 2004

In article <pan.2004. at>,
 Thomas Lindgaard <thomas at> wrote:

> How do I do that? Is there a way to check which exception is being caught
> - something along the lines of:
>   try:
>     # something throws an exception
>   except:
>     printHumanReadableDescriptionOfException()

You want something like:

import sys
    raise IndexError
    print sys.exc_info()

More information about the Python-list mailing list