fixed exception syntax for python3