Fix exception syntax for Py3