1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 07:55:06 +03:00

Use PySequence_GetItem preferentially

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é <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2023-09-20 18:28:56 +01:00 committed by Jiri Denemark
parent 85e58cb2ee
commit f76708b8fa

View File

@ -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(&params, &n, &max,
hints, nhints, keystr, v) < 0)
goto cleanup;