Skip to content

Commit

Permalink
Use Py_NewRef
Browse files Browse the repository at this point in the history
  • Loading branch information
encukou committed Mar 19, 2024
1 parent a13d207 commit 0351162
Showing 1 changed file with 1 addition and 2 deletions.
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

0 comments on commit 0351162

Please sign in to comment.