change how exeptions are handled, so they can be used by python3
Merge pull request #389 from simonsmiley/adapt-exceptions-to-python3

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