Fixup exception handling for python3

As reported by Jiloc

Fix #6, #7