summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_interp.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-04-01 08:55:00 (GMT)
committerGitHub <noreply@github.com>2022-04-01 08:55:00 (GMT)
commitf877b40e3f7e0d97878884d80fbec879a85ab7e8 (patch)
tree13a96fd70e9ccecd730d5cdd3c52b1303645f23b /Include/internal/pycore_interp.h
parentb9a5522dd952125a99ff554f01f311cae25f5a91 (diff)
downloadcpython-f877b40e3f7e0d97878884d80fbec879a85ab7e8.zip
cpython-f877b40e3f7e0d97878884d80fbec879a85ab7e8.tar.gz
cpython-f877b40e3f7e0d97878884d80fbec879a85ab7e8.tar.bz2
bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)
Move the private _PyFrameEvalFunction type, and private _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions to the internal C API. The _PyFrameEvalFunction callback function type now uses the _PyInterpreterFrame type which is part of the internal C API. Update the _PyFrameEvalFunction documentation.
Diffstat (limited to 'Include/internal/pycore_interp.h')
-rw-r--r--Include/internal/pycore_interp.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h
index d556279..592d438 100644
--- a/Include/internal/pycore_interp.h
+++ b/Include/internal/pycore_interp.h
@@ -17,9 +17,9 @@ extern "C" {
#include "pycore_dict.h" // struct _Py_dict_state
#include "pycore_exceptions.h" // struct _Py_exc_state
#include "pycore_floatobject.h" // struct _Py_float_state
+#include "pycore_gc.h" // struct _gc_runtime_state
#include "pycore_genobject.h" // struct _Py_async_gen_state
#include "pycore_gil.h" // struct _gil_runtime_state
-#include "pycore_gc.h" // struct _gc_runtime_state
#include "pycore_list.h" // struct _Py_list_state
#include "pycore_tuple.h" // struct _Py_tuple_state
#include "pycore_typeobject.h" // struct type_cache
@@ -71,6 +71,20 @@ struct atexit_state {
};
+/* Frame evaluation API (PEP 523) */
+
+typedef PyObject* (*_PyFrameEvalFunction) (
+ PyThreadState *tstate,
+ struct _PyInterpreterFrame *frame,
+ int throwflag);
+
+PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc(
+ PyInterpreterState *interp);
+PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc(
+ PyInterpreterState *interp,
+ _PyFrameEvalFunction eval_frame);
+
+
/* interpreter state */
/* PyInterpreterState holds the global state for one of the runtime's