mirror of
https://github.com/python/cpython.git
synced 2025-10-27 16:57:08 +00:00
- PyEval_GetFrame() is now declared to return a PyFrameObject *
instead of a plain PyObject *. (SF patch #686601 by Ben Laurie.)
This commit is contained in:
parent
162e38c6a3
commit
6297a7a9fb
6 changed files with 19 additions and 12 deletions
|
|
@ -3077,7 +3077,7 @@ PyEval_SetTrace(Py_tracefunc func, PyObject *arg)
|
|||
PyObject *
|
||||
PyEval_GetBuiltins(void)
|
||||
{
|
||||
PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame();
|
||||
PyFrameObject *current_frame = PyEval_GetFrame();
|
||||
if (current_frame == NULL)
|
||||
return PyThreadState_Get()->interp->builtins;
|
||||
else
|
||||
|
|
@ -3087,7 +3087,7 @@ PyEval_GetBuiltins(void)
|
|||
PyObject *
|
||||
PyEval_GetLocals(void)
|
||||
{
|
||||
PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame();
|
||||
PyFrameObject *current_frame = PyEval_GetFrame();
|
||||
if (current_frame == NULL)
|
||||
return NULL;
|
||||
PyFrame_FastToLocals(current_frame);
|
||||
|
|
@ -3097,31 +3097,31 @@ PyEval_GetLocals(void)
|
|||
PyObject *
|
||||
PyEval_GetGlobals(void)
|
||||
{
|
||||
PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame();
|
||||
PyFrameObject *current_frame = PyEval_GetFrame();
|
||||
if (current_frame == NULL)
|
||||
return NULL;
|
||||
else
|
||||
return current_frame->f_globals;
|
||||
}
|
||||
|
||||
PyObject *
|
||||
PyFrameObject *
|
||||
PyEval_GetFrame(void)
|
||||
{
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
return _PyThreadState_GetFrame((PyObject *)tstate);
|
||||
return _PyThreadState_GetFrame(tstate);
|
||||
}
|
||||
|
||||
int
|
||||
PyEval_GetRestricted(void)
|
||||
{
|
||||
PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame();
|
||||
PyFrameObject *current_frame = PyEval_GetFrame();
|
||||
return current_frame == NULL ? 0 : current_frame->f_restricted;
|
||||
}
|
||||
|
||||
int
|
||||
PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
|
||||
{
|
||||
PyFrameObject *current_frame = (PyFrameObject *)PyEval_GetFrame();
|
||||
PyFrameObject *current_frame = PyEval_GetFrame();
|
||||
int result = cf->cf_flags != 0;
|
||||
|
||||
if (current_frame != NULL) {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */
|
|||
static PyInterpreterState *interp_head = NULL;
|
||||
|
||||
PyThreadState *_PyThreadState_Current = NULL;
|
||||
unaryfunc _PyThreadState_GetFrame = NULL;
|
||||
PyThreadFrameGetter _PyThreadState_GetFrame = NULL;
|
||||
|
||||
|
||||
PyInterpreterState *
|
||||
|
|
@ -126,7 +126,7 @@ PyThreadState_New(PyInterpreterState *interp)
|
|||
{
|
||||
PyThreadState *tstate = PyMem_NEW(PyThreadState, 1);
|
||||
if (_PyThreadState_GetFrame == NULL)
|
||||
_PyThreadState_GetFrame = (unaryfunc)threadstate_getframe;
|
||||
_PyThreadState_GetFrame = threadstate_getframe;
|
||||
|
||||
if (tstate != NULL) {
|
||||
tstate->interp = interp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue