fix another case of python2 exception syntax to conform to python3