summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-02-01 10:42:03 (GMT)
committerGitHub <noreply@github.com>2021-02-01 10:42:03 (GMT)
commit0332e569c12d3dc97171546c6dc10e42c27de34b (patch)
tree1ef4cc33b19c2c7f24c157ffdfa61250ea2c9787 /Python/bltinmodule.c
parent49926cf2bcc8b44d9b8f148d81979ada191dd9d5 (diff)
downloadcpython-0332e569c12d3dc97171546c6dc10e42c27de34b.zip
cpython-0332e569c12d3dc97171546c6dc10e42c27de34b.tar.gz
cpython-0332e569c12d3dc97171546c6dc10e42c27de34b.tar.bz2
bpo-42990: Further refactoring of PyEval_ functions. (GH-24368)
* Further refactoring of PyEval_EvalCode and friends. Break into make-frame, and eval-frame parts. * Simplify function vector call using new _PyEval_Vector. * Remove unused internal functions: _PyEval_EvalCodeWithName and _PyEval_EvalCode. * Don't use legacy function PyEval_EvalCodeEx.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 352fb83..8c4e6e5 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -8,6 +8,7 @@
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_tuple.h" // _PyTuple_FromArray()
+#include "pycore_ceval.h" // _PyEval_Vector()
_Py_IDENTIFIER(__builtins__);
_Py_IDENTIFIER(__dict__);
@@ -219,9 +220,9 @@ builtin___build_class__(PyObject *self, PyObject *const *args, Py_ssize_t nargs,
Py_TYPE(ns)->tp_name);
goto error;
}
- cell = PyEval_EvalCodeEx(PyFunction_GET_CODE(func), PyFunction_GET_GLOBALS(func), ns,
- NULL, 0, NULL, 0, NULL, 0, NULL,
- PyFunction_GET_CLOSURE(func));
+ PyFrameConstructor *f = PyFunction_AS_FRAME_CONSTRUCTOR(func);
+ PyThreadState *tstate = PyThreadState_GET();
+ cell = _PyEval_Vector(tstate, f, ns, NULL, 0, NULL);
if (cell != NULL) {
if (bases != orig_bases) {
if (PyMapping_SetItemString(ns, "__orig_bases__", orig_bases) < 0) {