@@ -78,7 +78,7 @@ function::function(
7878 if (num_keywords != 0 )
7979 {
8080 for (unsigned j = 0 ; j < keyword_offset; ++j)
81- PyTuple_SET_ITEM (m_arg_names.ptr (), j, incref (Py_None));
81+ PyTuple_SetItem (m_arg_names.ptr (), j, incref (Py_None));
8282 }
8383
8484 for (unsigned i = 0 ; i < num_keywords; ++i)
@@ -96,7 +96,7 @@ function::function(
9696 kv = make_tuple (p->name );
9797 }
9898
99- PyTuple_SET_ITEM (
99+ PyTuple_SetItem (
100100 m_arg_names.ptr ()
101101 , i + keyword_offset
102102 , incref (kv.ptr ())
@@ -122,7 +122,7 @@ function::~function()
122122
123123PyObject* function::call (PyObject* args, PyObject* keywords) const
124124{
125- std::size_t n_unnamed_actual = PyTuple_GET_SIZE (args);
125+ std::size_t n_unnamed_actual = PyTuple_Size (args);
126126 std::size_t n_keyword_actual = keywords ? PyDict_Size (keywords) : 0 ;
127127 std::size_t n_actual = n_unnamed_actual + n_keyword_actual;
128128
@@ -167,28 +167,28 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
167167
168168 // Fill in the positional arguments
169169 for (std::size_t i = 0 ; i < n_unnamed_actual; ++i)
170- PyTuple_SET_ITEM (inner_args.get (), i, incref (PyTuple_GET_ITEM (args, i)));
170+ PyTuple_SetItem (inner_args.get (), i, incref (PyTuple_GetItem (args, i)));
171171
172172 // Grab remaining arguments by name from the keyword dictionary
173173 std::size_t n_actual_processed = n_unnamed_actual;
174174
175175 for (std::size_t arg_pos = n_unnamed_actual; arg_pos < max_arity ; ++arg_pos)
176176 {
177177 // Get the keyword[, value pair] corresponding
178- PyObject* kv = PyTuple_GET_ITEM (f->m_arg_names .ptr (), arg_pos);
178+ PyObject* kv = PyTuple_GetItem (f->m_arg_names .ptr (), arg_pos);
179179
180180 // If there were any keyword arguments,
181181 // look up the one we need for this
182182 // argument position
183183 PyObject* value = n_keyword_actual
184- ? PyDict_GetItem (keywords, PyTuple_GET_ITEM (kv, 0 ))
184+ ? PyDict_GetItem (keywords, PyTuple_GetItem (kv, 0 ))
185185 : 0 ;
186186
187187 if (!value)
188188 {
189189 // Not found; check if there's a default value
190- if (PyTuple_GET_SIZE (kv) > 1 )
191- value = PyTuple_GET_ITEM (kv, 1 );
190+ if (PyTuple_Size (kv) > 1 )
191+ value = PyTuple_GetItem (kv, 1 );
192192
193193 if (!value)
194194 {
@@ -203,7 +203,7 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
203203 ++n_actual_processed;
204204 }
205205
206- PyTuple_SET_ITEM (inner_args.get (), arg_pos, incref (value));
206+ PyTuple_SetItem (inner_args.get (), arg_pos, incref (value));
207207 }
208208
209209 if (inner_args.get ())
0 commit comments