Python3 exception compatiblity changes