Use Python3 compatible exception syntax