fix raising exception syntax in python 3

fix #2563