Skip to content

Commit 746ac92

Browse files
committed
add _PyObject_CallFunction_SizeT
1 parent 5851243 commit 746ac92

File tree

1 file changed

+13
-0
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+13
-0
lines changed

graalpython/com.oracle.graal.python.cext/src/object.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,19 @@ PyObject* PyObject_CallFunction(PyObject* callable, const char* fmt, ...) {
234234
return PyObject_CallObject(callable, args);
235235
}
236236

237+
PyObject* _PyObject_CallFunction_SizeT(PyObject* callable, const char* fmt, ...) {
238+
PyObject* args;
239+
CALL_WITH_VARARGS(args, Py_BuildValue, 2, fmt);
240+
if (strlen(fmt) < 2) {
241+
PyObject* singleArg = args;
242+
args = PyTuple_New(strlen(fmt));
243+
if (strlen(fmt) == 1) {
244+
PyTuple_SetItem(args, 0, singleArg);
245+
}
246+
}
247+
return PyObject_CallObject(callable, args);
248+
}
249+
237250
PyObject* PyObject_CallFunctionObjArgs(PyObject *callable, ...) {
238251
// the arguments are given as a variable list followed by NULL
239252
PyObject* args = PyTuple_New(polyglot_get_arg_count() - 2);

0 commit comments

Comments
 (0)