Skip to content

Commit d29acd6

Browse files
Address reviewer comments
1 parent 608356e commit d29acd6

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎Modules/_testinternalcapi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@ iframe_getlasti(PyObject *self, PyObject *frame)
15151515
}
15161516

15171517
// Reads the locals of the Python frame that called this C function using
1518-
// PyUnstable_InterpreterFrame_GetLocals and returns them as a name -> value
1518+
// PyUnstable_InterpreterFrame_GetLocal and returns them as a name -> value
15191519
// dict, skipping NULL (unset or hidden) slots.
15201520
static PyObject *
15211521
get_frame_locals(PyObject *self, PyObject *Py_UNUSED(ignored))

‎Objects/frameobject.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,10 +2274,11 @@ PyUnstable_InterpreterFrame_GetLocal(_PyInterpreterFrame *frame,
22742274

22752275
// Free variable: read from the function closure rather than localsplus.
22762276
if ((co->co_flags & CO_OPTIMIZED)
2277-
&& PyStackRef_FunctionCheck(frame->f_funcobj)) {
2277+
&& PyStackRef_FunctionCheck(frame->f_funcobj))
2278+
{
22782279
PyFunctionObject *func = _PyFrame_GetFunction(frame);
22792280
PyObject *cell = PyTuple_GET_ITEM(func->func_closure, index - offset);
2280-
return Py_XNewRef(PyCell_GET(cell));
2281+
return PyCell_GetRef((PyCellObject *)cell);
22812282
}
22822283
return NULL;
22832284
}

0 commit comments

Comments
 (0)