small exception-handling change to support py3 (compatible with py2.6+)
Merge pull request #2 from toyg/exc_handling

small exception-handling change to support py3 (compatible with py2.6+)