Skip to content

Commit

Permalink
gh-101101: Fix test_code_extra to reset value for refleak test (gh-10…
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Mar 2, 2023
1 parent 6059743 commit ed55c69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Modules/_testcapi/code.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ test_code_extra(PyObject* self, PyObject *Py_UNUSED(callable))
goto finally;
}
assert ((uintptr_t)extra == 77);

// Revert to initial code extra value.
res = PyUnstable_Code_SetExtra(test_func_code, code_extra_index, NULL);
if (res < 0) {
goto finally;
}
result = Py_NewRef(Py_None);
finally:
Py_XDECREF(test_module);
Expand Down

0 comments on commit ed55c69

Please sign in to comment.