fix for subversion 1.3.0

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8674 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-02-02 06:53:07 +00:00
commit 8484165901

View file

@ -383,8 +383,7 @@ PySwigObject_type(void) {
SWIGRUNTIMEINLINE int SWIGRUNTIMEINLINE int
PySwigObject_Check(PyObject *op) { PySwigObject_Check(PyObject *op) {
return ((op)->ob_type == PySwigObject_type()) return (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
|| (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
} }
SWIGRUNTIME PyObject * SWIGRUNTIME PyObject *
@ -898,6 +897,11 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
return 0; return 0;
} }
#endif #endif
if (obj && !PySwigObject_Check(obj)) {
/* a PyObject is called 'this', try to get the 'real this'
PySwigObject from it */
return SWIG_Python_GetSwigThis(obj);
}
return (PySwigObject *)obj; return (PySwigObject *)obj;
} }
} }