From 0b72b23fb0c130279f65f3bcd23521acf4a98c88 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 12 Mar 2020 23:18:39 +0100 Subject: bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() (GH-17340) PyInterpreterState.eval_frame function now requires a tstate (Python thread state) parameter. Add private functions to the C API to get and set the frame evaluation function: * Add tstate parameter to _PyFrameEvalFunction function type. * Add _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions. * Add tstate parameter to _PyEval_EvalFrameDefault(). --- Python/pystate.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Python/pystate.c') diff --git a/Python/pystate.c b/Python/pystate.c index 504f5f456d..9cf6bea1a0 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -1722,6 +1722,20 @@ _register_builtins_for_crossinterpreter_data(struct _xidregistry *xidregistry) } +_PyFrameEvalFunction +_PyInterpreterState_GetEvalFrameFunc(PyInterpreterState *interp) +{ + return interp->eval_frame; +} + + +void +_PyInterpreterState_SetEvalFrameFunc(PyInterpreterState *interp, + _PyFrameEvalFunction eval_frame) +{ + interp->eval_frame = eval_frame; +} + #ifdef __cplusplus } #endif -- cgit v1.2.1