Py2.5 does not support 'as'; also catch all exceptions for proper behavior