two Python 2.6+ syntax error

except syntax is different version 2.6 and afterwards, since there exists the latter syntax, I follow it.