Remove python2.6+ syntax to handle exceptions.