syntax chang from python2 to python3 when catching exceptions