Exception class change in tests for Py3 compatibility