diff options
author | Victor Stinner <vstinner@python.org> | 2019-11-14 11:20:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-14 11:20:46 (GMT) |
commit | b9e681261cd5ce6db0a79461c58d7cc52cfa4902 (patch) | |
tree | f7ae0bd04938d34e7af64b9c7a02f2d0318aa558 /Include | |
parent | 3ccdd9b180f9a3f29c8ddc8ad1b331fe8df26519 (diff) | |
download | cpython-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.h | 9 |
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 |