Skip to content

Commit ed55c69

Browse files
authoredMar 2, 2023
gh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)
1 parent 6059743 commit ed55c69

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+
// Revert to initial 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)