From: Victor Stinner Date: Fri, 1 Apr 2022 08:17:57 +0000 (+0200) Subject: bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052) X-Git-Tag: v3.11.0a7~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9a5522dd952125a99ff554f01f311cae25f5a91;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 16715c32502e..15f765dbe806 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 9d4eeafb427e..65aae2d669a5 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 45d26a37a34c..b29b496ee3f5 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 000000000000..1519ac7890e3 --- /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.