summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2019-11-14 11:20:46 (GMT)
committerGitHub <noreply@github.com>2019-11-14 11:20:46 (GMT)
commitb9e681261cd5ce6db0a79461c58d7cc52cfa4902 (patch)
treef7ae0bd04938d34e7af64b9c7a02f2d0318aa558 /Include
parent3ccdd9b180f9a3f29c8ddc8ad1b331fe8df26519 (diff)
downloadcpython-b9e681261cd5ce6db0a79461c58d7cc52cfa4902.zip
cpython-b9e681261cd5ce6db0a79461c58d7cc52cfa4902.tar.gz
cpython-b9e681261cd5ce6db0a79461c58d7cc52cfa4902.tar.bz2
bpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)
Add _PyEval_EvalFrame() static inline function to get eval_frame from tstate->interp.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_ceval.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index f20e4eb..7adb872 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -11,6 +11,9 @@ extern "C" {
/* Forward declarations */
struct pyruntimestate;
struct _ceval_runtime_state;
+struct _frame;
+
+#include "pycore_pystate.h" /* PyInterpreterState.eval_frame */
PyAPI_FUNC(void) _Py_FinishPendingCalls(struct pyruntimestate *runtime);
PyAPI_FUNC(void) _PyEval_Initialize(struct _ceval_runtime_state *);
@@ -34,6 +37,12 @@ PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(
/* Private function */
void _PyEval_Fini(void);
+static inline PyObject*
+_PyEval_EvalFrame(PyThreadState *tstate, struct _frame *f, int throwflag)
+{
+ return tstate->interp->eval_frame(f, throwflag);
+}
+
#ifdef __cplusplus
}
#endif