change how exeptions are handled, so they can be used by python3