Fix exception catching to be compatible with Python 3.
Merge pull request #4 from Flameeyes/master

Exception reformatting for Python 3 compatibility