mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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().
This commit is contained in:
parent
c846ef004d
commit
0b72b23fb0
9 changed files with 67 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue