From: Volker Lendecke Date: Tue, 26 Sep 2023 12:16:08 +0000 (+0200) Subject: pylibsmb: Py_BuildValue can build tuples directly X-Git-Tag: tevent-0.16.0~247 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7f1ee32a1b91addd84784954e3150afc2b3ae2bc;p=thirdparty%2Fsamba.git pylibsmb: Py_BuildValue can build tuples directly Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index deda81d16b4..9ac49437820 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -1209,26 +1209,10 @@ static PyObject *py_cli_create_ex( goto nomem; } - v = PyTuple_New(3); - if (v == NULL) { - goto nomem; - } - ret = PyTuple_SetItem(v, 0, Py_BuildValue("I", (unsigned)fnum)); - if (ret == -1) { - status = NT_STATUS_INTERNAL_ERROR; - goto fail; - } - ret = PyTuple_SetItem(v, 1, py_cr); - if (ret == -1) { - status = NT_STATUS_INTERNAL_ERROR; - goto fail; - } - ret = PyTuple_SetItem(v, 2, py_create_contexts_out); - if (ret == -1) { - status = NT_STATUS_INTERNAL_ERROR; - goto fail; - } - + v = Py_BuildValue("(IOO)", + (unsigned)fnum, + py_cr, + py_create_contexts_out); return v; nomem: status = NT_STATUS_NO_MEMORY;