Port the excepts to the Python3 syntax