Python SystemError fix with -builtin

Fix error when append on a SWIG Object with -builtin:

  x.append(10)
  SystemError: error return without exception set

Having append and next methods on a SWIG object by default doesn't seem
right to me though.
This commit is contained in:
William S Fulton 2015-11-14 22:14:32 +00:00
commit 4e8ea4e853

View file

@ -569,6 +569,7 @@ SwigPyObject_append(PyObject* v, PyObject* next)
next = tmp;
#endif
if (!SwigPyObject_Check(next)) {
PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
return NULL;
}
sobj->next = next;