Py3k-friendly exception handling.
Merge pull request #3 from kimgr/exceptions

Py3k-friendly exception handling.