[FIX] Use the sys.exc_info() function to follow python 2 standard