Skip to content

Commit 9539625

Browse files
committed
switch to Py_INCREF from Py_NewRef
1 parent de81d6d commit 9539625

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mod.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ static PyObject* run_stack_callback(PyObject* self, PyObject* args) {
135135
PyTuple_SetItem(tup, 0, obj);
136136
PyObject* result = PyObject_Call(func, tup, NULL);
137137
if (!result) return NULL;
138-
PyObject_SetAttrString(obj, "freed", Py_NewRef(Py_True));
138+
PyObject_SetAttrString(obj, "freed", Py_True);
139139

140-
return Py_NewRef(result);
140+
Py_INCREF(result);
141+
return result;
141142
}
142143

143144
static PyMethodDef methods[] = {

0 commit comments

Comments
 (0)