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

@ -2475,7 +2475,7 @@ get_basic_static_type(PyObject *self, PyObject *args)
PyTypeObject *cls = &BasicStaticTypes[num_basic_static_types_used++];
if (base != NULL) {
cls->tp_bases = Py_BuildValue("(O)", base);
cls->tp_bases = PyTuple_Pack(1, base);
if (cls->tp_bases == NULL) {
return NULL;
}
@ -3474,7 +3474,7 @@ typedef struct {
static PyObject *
ipowType_ipow(PyObject *self, PyObject *other, PyObject *mod)
{
return Py_BuildValue("OO", other, mod);
return PyTuple_Pack(2, other, mod);
}
static PyNumberMethods ipowType_as_number = {