diff options
author | Dong-hee Na <donghee.na@python.org> | 2023-03-02 11:32:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-02 11:32:05 (GMT) |
commit | ed55c69ebd74178115cd8b080f7f8e7588cd5fda (patch) | |
tree | 95facee0395a77c7666046332d0043cf36fd4140 | |
parent | 60597439ef482a840f8ffc76eb6c27f3ba773d9c (diff) | |
download | cpython-ed55c69ebd74178115cd8b080f7f8e7588cd5fda.zip cpython-ed55c69ebd74178115cd8b080f7f8e7588cd5fda.tar.gz cpython-ed55c69ebd74178115cd8b080f7f8e7588cd5fda.tar.bz2 |
gh-101101: Fix test_code_extra to reset value for refleak test (gh-102350)
-rw-r--r-- | Modules/_testcapi/code.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/_testcapi/code.c b/Modules/_testcapi/code.c index 588dc67..84c668c 100644 --- a/Modules/_testcapi/code.c +++ b/Modules/_testcapi/code.c @@ -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); |