mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
[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:
parent
a49a29f22b
commit
bb17e6f5de
8 changed files with 160 additions and 44 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue