summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-05 23:31:37 (GMT)
committerGitHub <noreply@github.com>2023-07-05 23:31:37 (GMT)
commitbb17e6f5de2bca85746a06d504029f90e85e3892 (patch)
tree826075fb8af05894f14c348b1ac2c9f7041bb2dd /Python/ceval.c
parenta49a29f22bcc39376e760823ec512df831d2e828 (diff)
downloadcpython-bb17e6f5de2bca85746a06d504029f90e85e3892.zip
cpython-bb17e6f5de2bca85746a06d504029f90e85e3892.tar.gz
cpython-bb17e6f5de2bca85746a06d504029f90e85e3892.tar.bz2
[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 104d7b760fed18055e4f04e5da3ca619e28bfc81) Co-authored-by: Carl Meyer <carl@oddbird.net>
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 4762dfa..c883a90 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2313,6 +2313,19 @@ PyEval_GetLocals(void)
}
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)
{
PyThreadState *tstate = _PyThreadState_GET();