Added 'parachute' std::exception handling to python interface

This commit is contained in:
Lorenzo Marcantonio 2012-08-29 19:32:14 +02:00
parent 0938f2cff6
commit 94fdc674aa
1 changed files with 10 additions and 3 deletions

View File

@ -52,8 +52,15 @@
{
char ExceptionError[256];
sprintf(ExceptionError, "%s\n", TO_UTF8(e.errorText) );
PyErr_SetString(PyExc_IOError,ExceptionError);
return NULL;
PyErr_SetString(PyExc_IOError,ExceptionError);
return NULL;
}
catch( std::exception &e )
{
char ExceptionError[256];
sprintf( ExceptionError, "%s\n", e.what() );
PyErr_SetString(PyExc_IOError,ExceptionError);
return NULL;
}
catch( ... )
{
@ -136,4 +143,4 @@
%include "plugins.i"
%include "units.i"