10 PyObject* PyROOT::TFunctionHolder::PreProcessArgs(
11 ObjectProxy*&
self, PyObject* args, PyObject* )
20 Py_ssize_t sz = PyTuple_GET_SIZE( args );
21 PyObject* newArgs = PyTuple_New( sz + 1 );
22 for (
int i = 0; i < sz; ++i ) {
23 PyObject* item = PyTuple_GET_ITEM( args, i );
25 PyTuple_SET_ITEM( newArgs, i + 1, item );
29 PyTuple_SET_ITEM( newArgs, 0, (PyObject*)
self );
37 PyObject* PyROOT::TFunctionHolder::Call(
38 ObjectProxy*&
self, PyObject* args, PyObject* kwds, TCallContext* ctxt )
40 if ( kwds != 0 && PyDict_Size( kwds ) ) {
41 PyErr_SetString( PyExc_TypeError,
"keyword arguments are not yet supported" );
46 if ( ! this->Initialize( ctxt ) )
50 if ( ! ( args = this->PreProcessArgs(
self, args, kwds ) ) )
54 Bool_t bConvertOk = this->ConvertAndSetArgs( args, ctxt );
57 if ( bConvertOk == kFALSE )
61 return this->Execute( 0, 0, ctxt );