mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
gh-100758: Refactor initialisation of frame headers into a single function (_PyFrame_Initialize) (GH-100759)
This commit is contained in:
parent
78068126a1
commit
15c44789bb
5 changed files with 21 additions and 53 deletions
|
@ -1974,11 +1974,8 @@ _PyEvalFramePushAndInit(PyThreadState *tstate, PyFunctionObject *func,
|
|||
if (frame == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
_PyFrame_InitializeSpecials(frame, func, locals, code);
|
||||
_PyFrame_Initialize(frame, func, locals, code, 0);
|
||||
PyObject **localsarray = &frame->localsplus[0];
|
||||
for (int i = 0; i < code->co_nlocalsplus; i++) {
|
||||
localsarray[i] = NULL;
|
||||
}
|
||||
if (initialize_locals(tstate, func, localsarray, args, argcount, kwnames)) {
|
||||
assert(frame->owner != FRAME_OWNED_BY_GENERATOR);
|
||||
_PyEvalFrameClearAndPop(tstate, frame);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue