Fix exception style for py3