Removed sys.exc_info from the except statement since it causes error