Use Py3K-compatible exception-handling syntax