gh-118379: Use PyTuple_Pack instead of Py_BuildValue if possible (GH-118381)

This commit is contained in:
Nice Zombies 2024-04-30 16:55:15 +02:00 committed by GitHub
parent 17a8af9508
commit 9a75d56d5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 9 additions and 9 deletions

View file

@ -1217,7 +1217,7 @@ init_ndbuf(PyObject *items, PyObject *shape, PyObject *strides,
/* convert scalar to list */
if (ndim == 0) {
items = Py_BuildValue("(O)", items);
items = PyTuple_Pack(1, items);
if (items == NULL)
return NULL;
}