Python: Use PyObject_SetAttr instead of PyObject_GenericSetAttr for back-ref

This commit is contained in:
Jake Cobb 2018-04-19 10:32:11 -04:00
commit 92df196408

View file

@ -49,7 +49,7 @@ namespace swig {
static PyObject* attr = SWIG_Python_str_FromChar("__owner");
SwigPyObject* swigThis = SWIG_Python_GetSwigThis(child);
if (swigThis && (swigThis->own & SWIG_POINTER_OWN) != SWIG_POINTER_OWN) {
PyObject_GenericSetAttr(child, attr, owner);
PyObject_SetAttr(child, attr, owner);
return true;
}
return false;