From b9a5522dd952125a99ff554f01f311cae25f5a91 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 1 Apr 2022 10:17:57 +0200 Subject: bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052) Move the private undocumented _PyEval_EvalFrameDefault() function to the internal C API. The function now uses the _PyInterpreterFrame type which is part of the internal C API. --- Doc/whatsnew/3.11.rst | 5 +++++ Include/cpython/ceval.h | 2 -- Include/internal/pycore_ceval.h | 5 +++++ Misc/NEWS.d/next/C API/2022-03-22-16-48-02.bpo-46850.7M5dO7.rst | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/C API/2022-03-22-16-48-02.bpo-46850.7M5dO7.rst diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 16715c3..15f765d 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -1097,6 +1097,11 @@ Porting to Python 3.11 * Distributors are encouraged to build Python with the optimized Blake2 library `libb2`_. +* Move the private undocumented ``_PyEval_EvalFrameDefault()`` function to the + internal C API. The function now uses the ``_PyInterpreterFrame`` type which + is part of the internal C API. + (Contributed by Victor Stinner in :issue:`46850`.) + Deprecated ---------- diff --git a/Include/cpython/ceval.h b/Include/cpython/ceval.h index 9d4eeaf..65aae2d 100644 --- a/Include/cpython/ceval.h +++ b/Include/cpython/ceval.h @@ -15,8 +15,6 @@ 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/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h index 45d26a3..b29b496 100644 --- a/Include/internal/pycore_ceval.h +++ b/Include/internal/pycore_ceval.h @@ -59,6 +59,11 @@ 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/Misc/NEWS.d/next/C API/2022-03-22-16-48-02.bpo-46850.7M5dO7.rst b/Misc/NEWS.d/next/C API/2022-03-22-16-48-02.bpo-46850.7M5dO7.rst new file mode 100644 index 0000000..1519ac7 --- /dev/null +++ b/Misc/NEWS.d/next/C API/2022-03-22-16-48-02.bpo-46850.7M5dO7.rst @@ -0,0 +1,3 @@ +Move the private undocumented ``_PyEval_EvalFrameDefault()`` function to the +internal C API. The function now uses the ``_PyInterpreterFrame`` type which is +part of the internal C API. Patch by Victor Stinner. -- cgit v0.12