Migrate except clauses from Python <=2.5 to Python >=2.6