Fix exception syntax to make python3 compatable.