Change exception handler for python2.6 (keyword "as" unsupported