@@ -750,7 +750,7 @@ instance_getattr(register PyInstanceObject *inst, PyObject *name)
750
750
if (!PyErr_ExceptionMatches (PyExc_AttributeError ))
751
751
return NULL ;
752
752
PyErr_Clear ();
753
- args = Py_BuildValue ( "(OO)" , inst , name );
753
+ args = PyTuple_Pack ( 2 , inst , name );
754
754
if (args == NULL )
755
755
return NULL ;
756
756
res = PyEval_CallObject (func , args );
@@ -847,9 +847,9 @@ instance_setattr(PyInstanceObject *inst, PyObject *name, PyObject *v)
847
847
if (func == NULL )
848
848
return instance_setattr1 (inst , name , v );
849
849
if (v == NULL )
850
- args = Py_BuildValue ( "(OO)" , inst , name );
850
+ args = PyTuple_Pack ( 2 , inst , name );
851
851
else
852
- args = Py_BuildValue ( "(OOO)" , inst , name , v );
852
+ args = PyTuple_Pack ( 3 , inst , name , v );
853
853
if (args == NULL )
854
854
return -1 ;
855
855
res = PyEval_CallObject (func , args );
@@ -1038,7 +1038,7 @@ instance_subscript(PyInstanceObject *inst, PyObject *key)
1038
1038
func = instance_getattr (inst , getitemstr );
1039
1039
if (func == NULL )
1040
1040
return NULL ;
1041
- arg = Py_BuildValue ( "(O)" , key );
1041
+ arg = PyTuple_Pack ( 1 , key );
1042
1042
if (arg == NULL ) {
1043
1043
Py_DECREF (func );
1044
1044
return NULL ;
@@ -1069,9 +1069,9 @@ instance_ass_subscript(PyInstanceObject *inst, PyObject *key, PyObject *value)
1069
1069
if (func == NULL )
1070
1070
return -1 ;
1071
1071
if (value == NULL )
1072
- arg = Py_BuildValue ( "(O)" , key );
1072
+ arg = PyTuple_Pack ( 1 , key );
1073
1073
else
1074
- arg = Py_BuildValue ( "(OO)" , key , value );
1074
+ arg = PyTuple_Pack ( 2 , key , value );
1075
1075
if (arg == NULL ) {
1076
1076
Py_DECREF (func );
1077
1077
return -1 ;
@@ -1281,7 +1281,7 @@ instance_contains(PyInstanceObject *inst, PyObject *member)
1281
1281
if (func ) {
1282
1282
PyObject * res ;
1283
1283
int ret ;
1284
- PyObject * arg = Py_BuildValue ( "(O)" , member );
1284
+ PyObject * arg = PyTuple_Pack ( 1 , member );
1285
1285
if (arg == NULL ) {
1286
1286
Py_DECREF (func );
1287
1287
return -1 ;
@@ -1346,7 +1346,7 @@ generic_binary_op(PyObject *v, PyObject *w, char *opname)
1346
1346
Py_INCREF (Py_NotImplemented );
1347
1347
return Py_NotImplemented ;
1348
1348
}
1349
- args = Py_BuildValue ( "(O)" , w );
1349
+ args = PyTuple_Pack ( 1 , w );
1350
1350
if (args == NULL ) {
1351
1351
Py_DECREF (func );
1352
1352
return NULL ;
@@ -1389,7 +1389,7 @@ half_binop(PyObject *v, PyObject *w, char *opname, binaryfunc thisfunc,
1389
1389
return generic_binary_op (v , w , opname );
1390
1390
}
1391
1391
1392
- args = Py_BuildValue ( "(O)" , w );
1392
+ args = PyTuple_Pack ( 1 , w );
1393
1393
if (args == NULL ) {
1394
1394
Py_DECREF (coercefunc );
1395
1395
return NULL ;
@@ -1474,7 +1474,7 @@ instance_coerce(PyObject **pv, PyObject **pw)
1474
1474
return 1 ;
1475
1475
}
1476
1476
/* Has __coerce__ method: call it */
1477
- args = Py_BuildValue ( "(O)" , w );
1477
+ args = PyTuple_Pack ( 1 , w );
1478
1478
if (args == NULL ) {
1479
1479
return -1 ;
1480
1480
}
@@ -1587,7 +1587,7 @@ half_cmp(PyObject *v, PyObject *w)
1587
1587
return 2 ;
1588
1588
}
1589
1589
1590
- args = Py_BuildValue ( "(O)" , w );
1590
+ args = PyTuple_Pack ( 1 , w );
1591
1591
if (args == NULL ) {
1592
1592
Py_DECREF (cmp_func );
1593
1593
return -2 ;
@@ -1747,7 +1747,7 @@ instance_pow(PyObject *v, PyObject *w, PyObject *z)
1747
1747
func = PyObject_GetAttrString (v , "__pow__" );
1748
1748
if (func == NULL )
1749
1749
return NULL ;
1750
- args = Py_BuildValue ( "(OO)" , w , z );
1750
+ args = PyTuple_Pack ( 2 , w , z );
1751
1751
if (args == NULL ) {
1752
1752
Py_DECREF (func );
1753
1753
return NULL ;
@@ -1786,7 +1786,7 @@ instance_ipow(PyObject *v, PyObject *w, PyObject *z)
1786
1786
PyErr_Clear ();
1787
1787
return instance_pow (v , w , z );
1788
1788
}
1789
- args = Py_BuildValue ( "(OO)" , w , z );
1789
+ args = PyTuple_Pack ( 2 , w , z );
1790
1790
if (args == NULL ) {
1791
1791
Py_DECREF (func );
1792
1792
return NULL ;
@@ -1859,7 +1859,7 @@ half_richcompare(PyObject *v, PyObject *w, int op)
1859
1859
return res ;
1860
1860
}
1861
1861
1862
- args = Py_BuildValue ( "(O)" , w );
1862
+ args = PyTuple_Pack ( 1 , w );
1863
1863
if (args == NULL ) {
1864
1864
Py_DECREF (method );
1865
1865
return NULL ;
0 commit comments