Fix exception handling format for Python <2.6