[Python-checkins] bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)

vstinner webhook-mailer at python.org
Fri Apr 1 04:18:09 EDT 2022


https://github.com/python/cpython/commit/b9a5522dd952125a99ff554f01f311cae25f5a91
commit: b9a5522dd952125a99ff554f01f311cae25f5a91
branch: main
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2022-04-01T10:17:57+02:00
summary:

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.

files:
A Misc/NEWS.d/next/C API/2022-03-22-16-48-02.bpo-46850.7M5dO7.rst
M Doc/whatsnew/3.11.rst
M Include/cpython/ceval.h
M Include/internal/pycore_ceval.h

diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst
index 16715c32502e4..15f765dbe806e 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 9d4eeafb427eb..65aae2d669a52 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 45d26a37a34c6..b29b496ee3f58 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 0000000000000..1519ac7890e37
--- /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.



More information about the Python-checkins mailing list