bpo-38644: Add _PyEval_EvalFrame() with tstate (GH-17131)

Add _PyEval_EvalFrame() static inline function to get eval_frame from
tstate->interp.
This commit is contained in:
Victor Stinner 2019-11-14 12:20:46 +01:00 committed by GitHub
parent 3ccdd9b180
commit b9e681261c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 7 deletions

View file

@ -1,4 +1,5 @@
#include "Python.h"
#include "pycore_ceval.h" /* _PyEval_EvalFrame() */
#include "pycore_object.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
@ -303,7 +304,7 @@ function_code_fastcall(PyCodeObject *co, PyObject *const *args, Py_ssize_t nargs
Py_INCREF(*args);
fastlocals[i] = *args++;
}
PyObject *result = PyEval_EvalFrameEx(f, 0);
PyObject *result = _PyEval_EvalFrame(tstate, f, 0);
if (Py_REFCNT(f) > 1) {
Py_DECREF(f);