Yoann Vandoorselaere
2015-04-24 16:32:26 UTC
Hi,
I am using the following code sequence in order to trigger custom Python
exception object, which used to work before enabling the builtin option:
SWIG_Python_Raise(SWIG_NewPointerObj(new PreludeError(e),
SWIGTYPE_p_Prelude__PreludeError, SWIG_POINTER_OWN), "PreludeError",
SWIGTYPE_p_Prelude__PreludeError);
Since we enabled builtin mode however, the code does not work anymore and
the triggered exception are always of type SWIG_RuntimeError.
The source of the problem seems to come from
the SWIG_Python_ExceptionType() function, because the clientdata->klass
member is never initialized in case builtin mode is used.
Returning clientdata->pytype seems to fix the problem for me, but I am not
sure whether that would be a correct, generic solution.
Any though ?
Regards,
I am using the following code sequence in order to trigger custom Python
exception object, which used to work before enabling the builtin option:
SWIG_Python_Raise(SWIG_NewPointerObj(new PreludeError(e),
SWIGTYPE_p_Prelude__PreludeError, SWIG_POINTER_OWN), "PreludeError",
SWIGTYPE_p_Prelude__PreludeError);
Since we enabled builtin mode however, the code does not work anymore and
the triggered exception are always of type SWIG_RuntimeError.
The source of the problem seems to come from
the SWIG_Python_ExceptionType() function, because the clientdata->klass
member is never initialized in case builtin mode is used.
Returning clientdata->pytype seems to fix the problem for me, but I am not
sure whether that would be a correct, generic solution.
Any though ?
Regards,