exception handling compat for Python 2.5