summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-03-20 16:46:56 (GMT)
committerGitHub <noreply@github.com>2020-03-20 16:46:56 (GMT)
commit6723e933c4d90a408cf3818362a0e4de6d84c932 (patch)
treefd3c18220235a2ad81a97a1a4728cb145c4fe4c8 /Python/ceval.c
parentfd1e1a18fa3befe5b6eeac32e0561e15c7e5164b (diff)
downloadcpython-6723e933c4d90a408cf3818362a0e4de6d84c932.zip
cpython-6723e933c4d90a408cf3818362a0e4de6d84c932.tar.gz
cpython-6723e933c4d90a408cf3818362a0e4de6d84c932.tar.bz2
bpo-39946: Remove _PyThreadState_GetFrame (GH-19094)
Remove _PyRuntime.getframe hook and remove _PyThreadState_GetFrame macro which was an alias to _PyRuntime.getframe. They were only exposed by the internal C API. Remove also PyThreadFrameGetter type.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index c80ee4b..836457d 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4825,25 +4825,18 @@ _PyEval_GetAsyncGenFinalizer(void)
return tstate->async_gen_finalizer;
}
-static PyFrameObject *
-_PyEval_GetFrame(PyThreadState *tstate)
-{
- _PyRuntimeState *runtime = tstate->interp->runtime;
- return runtime->gilstate.getframe(tstate);
-}
-
PyFrameObject *
PyEval_GetFrame(void)
{
PyThreadState *tstate = _PyThreadState_GET();
- return _PyEval_GetFrame(tstate);
+ return tstate->frame;
}
PyObject *
PyEval_GetBuiltins(void)
{
PyThreadState *tstate = _PyThreadState_GET();
- PyFrameObject *current_frame = _PyEval_GetFrame(tstate);
+ PyFrameObject *current_frame = tstate->frame;
if (current_frame == NULL)
return tstate->interp->builtins;
else
@@ -4869,7 +4862,7 @@ PyObject *
PyEval_GetLocals(void)
{
PyThreadState *tstate = _PyThreadState_GET();
- PyFrameObject *current_frame = _PyEval_GetFrame(tstate);
+ PyFrameObject *current_frame = tstate->frame;
if (current_frame == NULL) {
_PyErr_SetString(tstate, PyExc_SystemError, "frame does not exist");
return NULL;
@@ -4887,7 +4880,7 @@ PyObject *
PyEval_GetGlobals(void)
{
PyThreadState *tstate = _PyThreadState_GET();
- PyFrameObject *current_frame = _PyEval_GetFrame(tstate);
+ PyFrameObject *current_frame = tstate->frame;
if (current_frame == NULL) {
return NULL;
}
@@ -4900,7 +4893,7 @@ int
PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
{
PyThreadState *tstate = _PyThreadState_GET();
- PyFrameObject *current_frame = _PyEval_GetFrame(tstate);
+ PyFrameObject *current_frame = tstate->frame;
int result = cf->cf_flags != 0;
if (current_frame != NULL) {