[3.12] gh-105340: include hidden fast-locals in locals() (GH-105715) (#106470)

gh-105340: include hidden fast-locals in locals() (GH-105715)

* gh-105340: include hidden fast-locals in locals()
(cherry picked from commit 104d7b760f)

Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
Miss Islington (bot) 2023-07-05 16:31:37 -07:00 committed by GitHub
parent a49a29f22b
commit bb17e6f5de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 160 additions and 44 deletions

View file

@ -2312,6 +2312,19 @@ PyEval_GetLocals(void)
return locals;
}
PyObject *
_PyEval_GetFrameLocals(void)
{
PyThreadState *tstate = _PyThreadState_GET();
_PyInterpreterFrame *current_frame = _PyThreadState_GetFrame(tstate);
if (current_frame == NULL) {
_PyErr_SetString(tstate, PyExc_SystemError, "frame does not exist");
return NULL;
}
return _PyFrame_GetLocals(current_frame, 1);
}
PyObject *
PyEval_GetGlobals(void)
{