diff options
author | Victor Stinner <vstinner@python.org> | 2022-04-06 11:58:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-06 11:58:07 (GMT) |
commit | 2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c (patch) | |
tree | 8fd15ec78c5289f3eaf945d143d0c67ef16f5b95 /Include | |
parent | 1d3e743599673e9135d268fb72f0352d8ce23d97 (diff) | |
download | cpython-2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c.zip cpython-2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c.tar.gz cpython-2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c.tar.bz2 |
Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)" (GH-32343)
* Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)"
This reverts commit f877b40e3f7e0d97878884d80fbec879a85ab7e8.
* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)"
This reverts commit b9a5522dd952125a99ff554f01f311cae25f5a91.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/ceval.h | 2 | ||||
-rw-r--r-- | Include/cpython/pystate.h | 10 | ||||
-rw-r--r-- | Include/internal/pycore_ceval.h | 5 | ||||
-rw-r--r-- | Include/internal/pycore_interp.h | 16 | ||||
-rw-r--r-- | Include/internal/pycore_pystate.h | 2 |
5 files changed, 14 insertions, 21 deletions
diff --git a/Include/cpython/ceval.h b/Include/cpython/ceval.h index 65aae2d..9d4eeaf 100644 --- a/Include/cpython/ceval.h +++ b/Include/cpython/ceval.h @@ -15,6 +15,8 @@ PyAPI_FUNC(PyObject *) _PyEval_GetBuiltinId(_Py_Identifier *); flag was set, else return 0. */ PyAPI_FUNC(int) PyEval_MergeCompilerFlags(PyCompilerFlags *cf); +PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault(PyThreadState *tstate, struct _PyInterpreterFrame *f, int exc); + PyAPI_FUNC(void) _PyEval_SetSwitchInterval(unsigned long microseconds); PyAPI_FUNC(unsigned long) _PyEval_GetSwitchInterval(void); diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index e346d74..1af21a2 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -259,6 +259,16 @@ PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *); PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *); PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void); +/* Frame evaluation API */ + +typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int); + +PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc( + PyInterpreterState *interp); +PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc( + PyInterpreterState *interp, + _PyFrameEvalFunction eval_frame); + PyAPI_FUNC(const PyConfig*) _PyInterpreterState_GetConfig(PyInterpreterState *interp); /* Get a copy of the current interpreter configuration. diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index b29b496..45d26a3 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -59,11 +59,6 @@ extern PyObject* _PyEval_BuiltinsFromGlobals( PyObject *globals); -PyAPI_FUNC(PyObject *) _PyEval_EvalFrameDefault( - PyThreadState *tstate, - struct _PyInterpreterFrame *frame, - int throwflag); - static inline PyObject* _PyEval_EvalFrame(PyThreadState *tstate, struct _PyInterpreterFrame *frame, int throwflag) { diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 592d438..d556279 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,20 +71,6 @@ 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 diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index c463347..c4bc53c 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -8,7 +8,7 @@ extern "C" { # error "this header requires Py_BUILD_CORE define" #endif -#include "pycore_runtime.h" // _PyRuntime +#include "pycore_runtime.h" /* PyRuntimeState */ /* Check if the current thread is the main thread. |