return (PyObject *)ret;
}
+static PyObject *call_wrapper(PyObject *callable, PyObject *kwargs)
+{
+ /*
+ * Helper for calls with zero non-keyword arguments.
+ */
+ PyObject *empty = PyTuple_New(0), *result = NULL;
+ SMB_ASSERT(empty);
+ result = PyObject_Call(callable, empty, kwargs);
+ Py_XDECREF(empty);
+ return result;
+}
+
NTSTATUS provision_bare(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
struct provision_settings *settings,
struct provision_result *result)
goto out;
}
- py_result = PyEval_CallObjectWithKeywords(provision_fn, NULL, parameters);
+ py_result = call_wrapper(provision_fn, parameters);
if (py_result == NULL) {
status = NT_STATUS_UNSUCCESSFUL;
goto out;
}
- py_result = PyEval_CallObjectWithKeywords(provision_fn, NULL, parameters);
+ py_result = call_wrapper(provision_fn, parameters);
if (py_result == NULL) {
ldb_transaction_cancel(ldb);
}
}
- py_result = PyEval_CallObjectWithKeywords(schema_fn, NULL, parameters);
+ py_result = call_wrapper(schema_fn, parameters);
Py_DECREF(parameters);