Skip to content

Commit

Permalink
pythongh-101101: Fix test_code_extra to reset value for refleak test
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Mar 1, 2023
1 parent 7d1d663 commit dcb4d94
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);

// Need to reset 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 dcb4d94

Please sign in to comment.