From f76708b8fadef0c3ebf09f953801789fd34b2664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 20 Sep 2023 18:28:56 +0100 Subject: [PATCH] Use PySequence_GetItem preferentially MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although marginally faster, PySequence_ITEM is not part of the stable API and also omits some safety checks. It is better for us to be using PySequence_GetItem instead. Signed-off-by: Daniel P. BerrangĂ© --- libvirt-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvirt-utils.c b/libvirt-utils.c index ee2b118..155fdff 100644 --- a/libvirt-utils.c +++ b/libvirt-utils.c @@ -534,7 +534,7 @@ virPyDictToTypedParams(PyObject *dict, Py_ssize_t i, size = PySequence_Size(value); for (i = 0; i < size; i++) { - PyObject *v = PySequence_ITEM(value, i); + PyObject *v = PySequence_GetItem(value, i); if (virPyDictToTypedParamOne(¶ms, &n, &max, hints, nhints, keystr, v) < 0) goto cleanup;