mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-118379: Use PyTuple_Pack instead of Py_BuildValue if possible (GH-118381)
This commit is contained in:
parent
17a8af9508
commit
9a75d56d5d
6 changed files with 9 additions and 9 deletions
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue