[3.12] gh-110241: Add missing error check to record_eval in _testinternalcapi (GH-110242) (#110244)

gh-110241: Add missing error check to `record_eval` in `_testinternalcapi` (GH-110242)
(cherry picked from commit 4596c76d1a)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
Miss Islington (bot) 2023-10-02 14:38:25 -07:00 committed by GitHub
parent 74d0b60811
commit 892b1942a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -683,7 +683,11 @@ record_eval(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc)
assert(module != NULL);
module_state *state = get_module_state(module);
Py_DECREF(module);
PyList_Append(state->record_list, ((PyFunctionObject *)f->f_funcobj)->func_name);
int res = PyList_Append(state->record_list,
((PyFunctionObject *)f->f_funcobj)->func_name);
if (res < 0) {
return NULL;
}
}
return _PyEval_EvalFrameDefault(tstate, f, exc);
}