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