Merge pull request #978 from alex/exception-import-fix

Don't import the exceptions module directly.