py_conditionlist is an owned reference (it gets passed to Py_DecRef()
at the end), so we need to increment the refcount when assigning it
from the borrowed reference py_conds.
num_conditions = PyList_Size(py_conditionlist);
if (num_conditions == 0)
return 9999; /* The PD invoked self.wait([]). */
+ Py_IncRef(py_conditionlist);
} else if (PyDict_Check(py_conds)) {
/* 'py_conds' is a dict. */
if (PyDict_Size(py_conds) == 0)