We currently use a mix of Py_IncRef/Py_DecRef and Py_XINCREF/Py_XDECREF
or Py_INCREF/Py_DECREF in the code-base. Only use the latter variants
for the time being (for consistency).
PyGILState_Release(gstate);
return SRD_ERR_PYTHON;
}
PyGILState_Release(gstate);
return SRD_ERR_PYTHON;
}
/* Set self.samplenum to 0. */
py_samplenum = PyLong_FromLong(0);
/* Set self.samplenum to 0. */
py_samplenum = PyLong_FromLong(0);
* Call self.decode(). Only returns if the PD throws an exception.
* "Regular" termination of the decode() method is not expected.
*/
* Call self.decode(). Only returns if the PD throws an exception.
* "Regular" termination of the decode() method is not expected.
*/
- Py_IncRef(di->py_inst);
+ Py_INCREF(di->py_inst);
srd_dbg("%s: Calling decode().", di->inst_id);
py_res = PyObject_CallMethod(di->py_inst, "decode", NULL);
srd_dbg("%s: decode() terminated.", di->inst_id);
srd_dbg("%s: Calling decode().", di->inst_id);
py_res = PyObject_CallMethod(di->py_inst, "decode", NULL);
srd_dbg("%s: decode() terminated.", di->inst_id);
* decode() will re-start another thread transparently.
*/
srd_dbg("%s: decode() terminated (req %d).", di->inst_id, wanted_term);
* decode() will re-start another thread transparently.
*/
srd_dbg("%s: decode() terminated (req %d).", di->inst_id, wanted_term);
PyErr_Clear();
PyGILState_Release(gstate);
PyErr_Clear();
PyGILState_Release(gstate);
srd_inst_reset_state(di);
gstate = PyGILState_Ensure();
srd_inst_reset_state(di);
gstate = PyGILState_Ensure();
- Py_DecRef(di->py_inst);
+ Py_DECREF(di->py_inst);
PyGILState_Release(gstate);
g_free(di->inst_id);
PyGILState_Release(gstate);
g_free(di->inst_id);
num_conditions = PyList_Size(py_conditionlist);
if (num_conditions == 0)
goto ret_9999; /* The PD invoked self.wait([]). */
num_conditions = PyList_Size(py_conditionlist);
if (num_conditions == 0)
goto ret_9999; /* The PD invoked self.wait([]). */
- Py_IncRef(py_conditionlist);
+ Py_INCREF(py_conditionlist);
} else if (PyDict_Check(py_conds)) {
/* 'py_conds' is a dict. */
if (PyDict_Size(py_conds) == 0)
goto ret_9999; /* The PD invoked self.wait({}). */
/* Make a list and put the dict in there for convenience. */
py_conditionlist = PyList_New(1);
} else if (PyDict_Check(py_conds)) {
/* 'py_conds' is a dict. */
if (PyDict_Size(py_conds) == 0)
goto ret_9999; /* The PD invoked self.wait({}). */
/* Make a list and put the dict in there for convenience. */
py_conditionlist = PyList_New(1);
PyList_SetItem(py_conditionlist, 0, py_conds);
num_conditions = 1;
} else {
PyList_SetItem(py_conditionlist, 0, py_conds);
num_conditions = 1;
} else {