8000 bpo-44800: rename _PyInterpreterFrame to _Py_frame by ncoghlan · Pull Request #31987 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-44800: rename _PyInterpreterFrame to _Py_frame #31987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename fdata->f_builtins to fdata->builtins
  • Loading branch information
ncoghlan committed Mar 19, 2022
commit bcafd653a2ea9e674ed6b0f8e41321ebdc82d056
4 changes: 2 additions & 2 deletions Include/internal/pycore_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ typedef signed char PyFrameState;
typedef struct _Py_frame {
PyFunctionObject *func; /* Strong reference */
PyObject *globals; /* Borrowed reference */
PyObject *f_builtins; /* Borrowed reference */
PyObject *builtins; /* Borrowed reference */
PyObject *f_locals; /* Strong reference, may be NULL */
PyCodeObject *f_code; /* Strong reference */
PyFrameObject *frame_obj; /* Strong reference, may be NULL */
Expand Down Expand Up @@ -154,7 +154,7 @@ _PyFrame_InitializeSpecials(
{
frame->func = func;
frame->f_code = (PyCodeObject *)Py_NewRef(func->func_code);
frame->f_builtins = func->func_builtins;
frame->builtins = func->func_builtins;
frame->globals = func->func_globals;
frame->f_locals = Py_XNewRef(locals);
frame->stacktop = nlocalsplus;
Expand Down
2 changes: 1 addition & 1 deletion Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ frame_getglobals(PyFrameObject *f, void *closure)
static PyObject *
frame_getbuiltins(PyFrameObject *f, void *closure)
{
PyObject *builtins = f->f_frame->f_builtins;
PyObject *builtins = f->f_frame->builtins;
if (builtins == NULL) {
builtins = Py_None;
}
Expand Down
6 changes: 3 additions & 3 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ eval_frame_handle_pending(PyThreadState *tstate)


#define GLOBALS() frame->globals
#define BUILTINS() frame->f_builtins
#define BUILTINS() frame->builtins
#define LOCALS() frame->f_locals

/* Shared opcode macros */
Expand Down Expand Up @@ -6934,7 +6934,7 @@ _PyEval_GetBuiltins(PyThreadState *tstate)
{
_Py_frame *frame = tstate->cframe->current_frame;
if (frame != NULL) {
return frame->f_builtins;
return frame->builtins;
}
return tstate->interp->builtins;
}
Expand Down Expand Up @@ -7205,7 +7205,7 @@ import_name(PyThreadState *tstate, _Py_frame *frame,
PyObject *import_func, *res;
PyObject* stack[5];

import_func = _PyDict_GetItemWithError(frame->f_builtins, &_Py_ID(__import__));
import_func = _PyDict_GetItemWithError(frame->builtins, &_Py_ID(__import__));
if (import_func == NULL) {
if (!_PyErr_Occurred(tstate)) {
_PyErr_SetString(tstate, PyExc_ImportError, "__import__ not found");
Expand Down
2 changes: 1 addition & 1 deletion Python/suggestions.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ offer_suggestions_for_name_error(PyNameErrorObject *exc)
return suggestions;
}

dir = PySequence_List(frame->f_frame->f_builtins);
dir = PySequence_List(frame->f_frame->builtins);
if (dir == NULL) {
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion Tools/gdb/libpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ def _f_globals(self):
return self._f_special("globals")

def _f_builtins(self):
return self._f_special("f_builtins")
return self._f_special("builtins")

def _f_code(self):
return self._f_special("f_code", PyCodeObjectPtr.from_pyobject_ptr)
Expand Down
0