Skip to content

Commit f76708b

Browse files
berrangeJiri Denemark
authored and
Jiri Denemark
committed
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é <[email protected]>
1 parent 85e58cb commit f76708b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libvirt-utils.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ virPyDictToTypedParams(PyObject *dict,
534534
Py_ssize_t i, size = PySequence_Size(value);
535535

536536
for (i = 0; i < size; i++) {
537-
PyObject *v = PySequence_ITEM(value, i);
537+
PyObject *v = PySequence_GetItem(value, i);
538538
if (virPyDictToTypedParamOne(&params, &n, &max,
539539
hints, nhints, keystr, v) < 0)
540540
goto cleanup;

0 commit comments

Comments
 (0)