compatibility with python 3.x

except syntax using "as" keywords instead of comma ","