fix python 3 exception syntax