#include "pycore_function.h" // _PyFunction_FromConstructor()
#include "pycore_genobject.h" // _PyGen_GetGeneratorFromFrame()
#include "pycore_interpframe.h" // _PyFrame_GetLocalsArray()
+#include "pycore_list.h" // _PyList_AppendTakeRef()
#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_opcode_metadata.h" // _PyOpcode_Caches
goto error;
}
- int rc = PyList_Append(items, pair);
- Py_DECREF(pair);
- if (rc < 0) {
+ if (_PyList_AppendTakeRef((PyListObject *)items, pair) < 0) {
goto error;
}
}
goto error;
}
- int rc = PyList_Append(items, pair);
- Py_DECREF(pair);
- if (rc < 0) {
+ if (_PyList_AppendTakeRef((PyListObject *)items, pair) < 0) {
goto error;
}
}