Skip to content

Commit

Permalink
Dont use vectorcall..
Browse files Browse the repository at this point in the history
  • Loading branch information
frmdstryr committed Jan 18, 2025
1 parent b83f5d7 commit b061af8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions enaml/src/subscription_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,15 @@ SubscriptionObserver_call( SubscriptionObserver* self, PyObject* args, PyObject*
return 0;
if ( !engine.is_none() )
{
PyObject* call_args[] = { engine.get(), owner.get(), self->name };
size_t nargsf = 2 | PY_VECTORCALL_ARGUMENTS_OFFSET;
return PyObject_VectorcallMethod(update_str.get(), call_args, nargsf, 0);
cppy::ptr update_args( PyTuple_New( 2 ) );
if( !update_args )
return 0;
PyTuple_SET_ITEM( update_args.get(), 0, cppy::incref( owner.get() ) );
PyTuple_SET_ITEM( update_args.get(), 1, cppy::incref( self->name ) );
cppy::ptr update( engine.getattr( update_str.get() ) );
if ( !update )
return 0;
return update.call( update_args );
}
}
Py_RETURN_NONE;
Expand Down

0 comments on commit b061af8

Please sign in to comment.