more fixes for exceptions

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5944 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-05-29 23:19:01 +00:00
commit 6caba9c765

View file

@ -226,9 +226,8 @@
SWIG_fail;
}
/* This doesn't work, and not sure if it is needed... */
#if 0
%typecheck(throws) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
%typemap(throws) SWIGTYPE * {
if ($1_descriptor->clientdata) {
PyErr_SetObject((PyObject *) ($1_descriptor->clientdata), SWIG_NewPointerObj($1,$1_descriptor,1));
} else {
@ -236,5 +235,22 @@
}
SWIG_fail;
}
#endif
%typemap(throws) SWIGTYPE [ANY] {
if ($1_descriptor->clientdata) {
PyErr_SetObject((PyObject *) ($1_descriptor->clientdata), SWIG_NewPointerObj($1,$1_descriptor,1));
} else {
PyErr_SetString(PyExc_RuntimeError,"$1_type");
}
SWIG_fail;
}
%typemap(throws) SWIGTYPE & {
if ($1_descriptor->clientdata) {
PyErr_SetObject((PyObject *) ($1_descriptor->clientdata), SWIG_NewPointerObj(&($1),$1_descriptor,1));
} else {
PyErr_SetString(PyExc_RuntimeError,"$1_type");
}
SWIG_fail;
}