Skip to content

Commit

Permalink
Replace one call
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Oct 23, 2024
1 parent b0e1892 commit a922566
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/conversions.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,12 @@ as_status pyobject_to_as_privileges(as_error *err, PyObject *py_privileges,
{
as_error_reset(err);
for (int i = 0; i < privileges_size; i++) {
PyObject *py_val = PyList_GetItem(py_privileges, i);
PyObject *py_val = PyList_GetItemRef(py_privileges, i);
if (py_val == NULL) {
PyErr_Clear();
as_error_update(err, AEROSPIKE_ERR_CLIENT,
"Unable to get privilege at index %d", i);
}
if (PyDict_Check(py_val)) {
PyObject *py_dict_key = PyUnicode_FromString("code");
if (PyDict_Contains(py_val, py_dict_key)) {
Expand Down Expand Up @@ -286,6 +291,7 @@ as_status pyobject_to_as_privileges(as_error *err, PyObject *py_privileges,
}
Py_DECREF(py_dict_key);
}
Py_DECREF(py_val);
}
return err->code;
}
Expand Down

0 comments on commit a922566

Please sign in to comment.