Updating exception syntax for Python 3