Try:
import traceback
traceback.print_exc()
Instead of directly printing the exception object. In Python exception objects, objects are not tied directly to the stack trace — instead, they are part of a trio of elements in sys.exc_info ().
You can also do:
import System
...
except System.Exception, e:
and you get a regular .NET exception object instead of a Python exception object.
source
share