@@ -297,7 +297,8 @@ call_object_object_value_handler( Member* member, CAtom* atom, PyObject* value )
297297 if ( !valueptr )
298298 return -1 ;
299299 PyObject* args[] = { pyobject_cast ( atom ), valueptr.get () };
300- if ( !PyObject_Vectorcall ( member->setattr_context , args, 2 , 0 ) )
300+ cppy::ptr ok ( PyObject_Vectorcall ( member->setattr_context , args, 2 , 0 ) );
301+ if ( !ok )
301302 return -1 ;
302303 return 0 ;
303304}
@@ -310,7 +311,8 @@ call_object_object_name_value_handler( Member* member, CAtom* atom, PyObject* va
310311 if ( !valueptr )
311312 return -1 ;
312313 PyObject* args[] = { pyobject_cast ( atom ), member->name , valueptr.get () };
313- if ( !PyObject_Vectorcall ( member->setattr_context , args, 3 , 0 ) )
314+ cppy::ptr ok ( PyObject_Vectorcall ( member->setattr_context , args, 3 , 0 ) );
315+ if ( !ok )
314316 return -1 ;
315317 return 0 ;
316318}
@@ -322,7 +324,8 @@ object_method_value_handler( Member* member, CAtom* atom, PyObject* value )
322324 cppy::ptr valueptr ( member->full_validate ( atom, Py_None, value ) );
323325 if ( !valueptr )
324326 return -1 ;
325- if ( !PyObject_CallMethodOneArg ( pyobject_cast ( atom ), member->setattr_context , valueptr.get () ) )
327+ cppy::ptr ok ( PyObject_CallMethodOneArg ( pyobject_cast ( atom ), member->setattr_context , valueptr.get () ) );
328+ if ( !ok )
326329 return -1 ;
327330 return 0 ;
328331}
@@ -335,7 +338,8 @@ object_method_name_value_handler( Member* member, CAtom* atom, PyObject* value )
335338 if ( !valueptr )
336339 return -1 ;
337340 PyObject* args[] = { pyobject_cast ( atom ), member->name , valueptr.get () };
338- if ( !PyObject_VectorcallMethod ( member->setattr_context , args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, 0 ) )
341+ cppy::ptr ok ( PyObject_VectorcallMethod ( member->setattr_context , args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, 0 ) );
342+ if ( !ok )
339343 return -1 ;
340344 return 0 ;
341345}
@@ -348,7 +352,8 @@ member_method_object_value_handler( Member* member, CAtom* atom, PyObject* value
348352 if ( !valueptr )
349353 return -1 ;
350354 PyObject* args[] = { pyobject_cast ( member ), pyobject_cast ( atom ), valueptr.get () };
351- if ( !PyObject_VectorcallMethod ( member->setattr_context , args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, 0 ) )
355+ cppy::ptr ok ( PyObject_VectorcallMethod ( member->setattr_context , args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, 0 ) );
356+ if ( !ok )
352357 return -1 ;
353358 return 0 ;
354359}
0 commit comments