diff options
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.11.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index b2fdb48..8c120ec 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -969,7 +969,7 @@ Porting to Python 3.11 Code using ``f_lasti`` with ``PyCode_Addr2Line()`` must use :c:func:`PyFrame_GetLineNumber` instead. * ``f_lineno``: use :c:func:`PyFrame_GetLineNumber` - * ``f_locals``: use ``PyObject_GetAttrString((PyObject*)frame, "f_locals")``. + * ``f_locals``: use :c:func:`PyFrame_GetLocals`. * ``f_stackdepth``: removed. * ``f_state``: no public API (renamed to ``f_frame.f_state``). * ``f_trace``: no public API. @@ -983,6 +983,12 @@ Porting to Python 3.11 computed lazily. The :c:func:`PyFrame_GetBack` function must be called instead. + Debuggers that accessed the ``f_locals`` directly *must* call + `:c:func:`PyFrame_GetLocals` instead. They no longer need to call + `:c:func:`PyFrame_FastToLocalsWithError` or :c:func:`PyFrame_LocalsToFast`, + in fact they should not call those functions. The necessary updating of the + frame is now managed by the virtual machine. + Code defining ``PyFrame_GetCode()`` on Python 3.8 and older:: #if PY_VERSION_HEX < 0x030900B1 |