diff options
author | Victor Stinner <vstinner@python.org> | 2020-03-12 22:18:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-12 22:18:39 (GMT) |
commit | 0b72b23fb0c130279f65f3bcd23521acf4a98c88 (patch) | |
tree | 2e2bbdef31294861783eeea4da94a02b8715f4c9 /Python/pystate.c | |
parent | c846ef004d79ee8e9645d3e5e8b3b0cb97b5013f (diff) | |
download | cpython-0b72b23fb0c130279f65f3bcd23521acf4a98c88.zip cpython-0b72b23fb0c130279f65f3bcd23521acf4a98c88.tar.gz cpython-0b72b23fb0c130279f65f3bcd23521acf4a98c88.tar.bz2 |
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().
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 504f5f4..9cf6bea 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 |