add castmode in python and cleaning the castdispatch mechanism
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8051 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
cd5224c0b1
commit
5a76bc68fc
16 changed files with 461 additions and 101 deletions
|
|
@ -99,7 +99,7 @@ namespace swig {
|
|||
struct traits_as<Type, value_category> {
|
||||
static Type as(PyObject *obj, bool throw_error) {
|
||||
Type v;
|
||||
if (!obj || (asval(obj, &v) != SWIG_OK)) {
|
||||
if (!obj || !SWIG_IsOK(asval(obj, &v))) {
|
||||
if (!PyErr_Occurred()) {
|
||||
%type_error(swig::type_name<Type>());
|
||||
}
|
||||
|
|
@ -160,7 +160,7 @@ namespace swig {
|
|||
template <class Type>
|
||||
struct traits_check<Type, value_category> {
|
||||
static bool check(PyObject *obj) {
|
||||
return obj && (asval(obj, (Type *)(0)) == SWIG_OK);
|
||||
return obj && SWIG_IsOK(asval(obj, (Type *)(0)));
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue