@@ -3559,10 +3559,10 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
35593559 PyObject * args ;
35603560 PyObject * kwargs ;
35613561
3562- if (Py_SIZE (argtup ) != 3 ) {
3562+ if (PyTuple_GET_SIZE (argtup ) != 3 ) {
35633563 PyErr_Format (st -> PicklingError ,
35643564 "length of the NEWOBJ_EX argument tuple must be "
3565- "exactly 3, not %zd" , Py_SIZE (argtup ));
3565+ "exactly 3, not %zd" , PyTuple_GET_SIZE (argtup ));
35663566 return -1 ;
35673567 }
35683568
@@ -3602,7 +3602,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
36023602 Py_ssize_t i ;
36033603 _Py_IDENTIFIER (__new__ );
36043604
3605- newargs = PyTuple_New (Py_SIZE (args ) + 2 );
3605+ newargs = PyTuple_New (PyTuple_GET_SIZE (args ) + 2 );
36063606 if (newargs == NULL )
36073607 return -1 ;
36083608
@@ -3614,7 +3614,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
36143614 PyTuple_SET_ITEM (newargs , 0 , cls_new );
36153615 Py_INCREF (cls );
36163616 PyTuple_SET_ITEM (newargs , 1 , cls );
3617- for (i = 0 ; i < Py_SIZE (args ); i ++ ) {
3617+ for (i = 0 ; i < PyTuple_GET_SIZE (args ); i ++ ) {
36183618 PyObject * item = PyTuple_GET_ITEM (args , i );
36193619 Py_INCREF (item );
36203620 PyTuple_SET_ITEM (newargs , i + 2 , item );
@@ -3649,7 +3649,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
36493649 int p ;
36503650
36513651 /* Sanity checks. */
3652- if (Py_SIZE (argtup ) < 1 ) {
3652+ if (PyTuple_GET_SIZE (argtup ) < 1 ) {
36533653 PyErr_SetString (st -> PicklingError , "__newobj__ arglist is empty" );
36543654 return -1 ;
36553655 }
@@ -3702,7 +3702,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
37023702 if (save (self , cls , 0 ) < 0 )
37033703 return -1 ;
37043704
3705- newargtup = PyTuple_GetSlice (argtup , 1 , Py_SIZE (argtup ));
3705+ newargtup = PyTuple_GetSlice (argtup , 1 , PyTuple_GET_SIZE (argtup ));
37063706 if (newargtup == NULL )
37073707 return -1 ;
37083708
@@ -4431,7 +4431,7 @@ Pickler_set_memo(PicklerObject *self, PyObject *obj)
44314431 Py_ssize_t memo_id ;
44324432 PyObject * memo_obj ;
44334433
4434- if (!PyTuple_Check (value ) || Py_SIZE (value ) != 2 ) {
4434+ if (!PyTuple_Check (value ) || PyTuple_GET_SIZE (value ) != 2 ) {
44354435 PyErr_SetString (PyExc_TypeError ,
44364436 "'memo' values must be 2-item tuples" );
44374437 goto error ;
@@ -5168,7 +5168,7 @@ instantiate(PyObject *cls, PyObject *args)
51685168 Pdata_poptuple which packs objects from the top of the stack
51695169 into a newly created tuple. */
51705170 assert (PyTuple_Check (args ));
5171- if (Py_SIZE (args ) > 0 || !PyType_Check (cls ) ||
5171+ if (PyTuple_GET_SIZE (args ) > 0 || !PyType_Check (cls ) ||
51725172 _PyObject_HasAttrId (cls , & PyId___getinitargs__ )) {
51735173 result = PyObject_CallObject (cls , args );
51745174 }
@@ -6048,7 +6048,7 @@ load_build(UnpicklerObject *self)
60486048 /* A default __setstate__. First see whether state embeds a
60496049 * slot state dict too (a proto 2 addition).
60506050 */
6051- if (PyTuple_Check (state ) && Py_SIZE (state ) == 2 ) {
6051+ if (PyTuple_Check (state ) && PyTuple_GET_SIZE (state ) == 2 ) {
60526052 PyObject * tmp = state ;
60536053
60546054 state = PyTuple_GET_ITEM (tmp , 0 );
0 commit comments