Skip to content

Commit dcb4d94

Browse files
committed
pythongh-101101: Fix test_code_extra to reset value for refleak test
1 parent 7d1d663 commit dcb4d94

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Modules/_testcapi/code.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ test_code_extra(PyObject* self, PyObject *Py_UNUSED(callable))
9292
goto finally;
9393
}
9494
assert ((uintptr_t)extra == 77);
95-
95+
// Need to reset code extra value.
96+
res = PyUnstable_Code_SetExtra(test_func_code, code_extra_index, NULL);
97+
if (res < 0) {
98+
goto finally;
99+
}
96100
result = Py_NewRef(Py_None);
97101
finally:
98102
Py_XDECREF(test_module);

0 commit comments

Comments
 (0)