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:
parent
2febdc6ecb
commit
6caba9c765
1 changed files with 20 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue