Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Py_NewRef
  • Loading branch information
encukou committed Mar 19, 2024
commit 0351162a9a01c49adad8a5bd2ece51ce44a44520
3 changes: 1 addition & 2 deletions Modules/_testcapimodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3099,8 +3099,7 @@ function_get_closure(PyObject *self, PyObject *func)
{
PyObject *closure = PyFunction_GetClosure(func);
if (closure != NULL) {
Py_INCREF(closure);
return closure;
return Py_NewRef(closure);
} else if (PyErr_Occurred()) {
return NULL;
} else {
Expand Down