Question

See the title of this question. I want to play with the exception raised in the last command. _ didn't help me. Is there anything like that?

Was it helpful?

Solution

Do this:

import sys
sys.exc_info()

It will give you information about the exception. It's a tuple containing the exception type, the exception instance and a traceback object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top