gh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)

This commit is contained in:
Dong-hee Na 2023-03-02 20:32:05 +09:00 committed by GitHub
parent 60597439ef
commit ed55c69ebd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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);