]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-40421: Add PyFrame_GetCode() function (GH-19757)
authorVictor Stinner <vstinner@python.org>
Tue, 28 Apr 2020 17:01:31 +0000 (19:01 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Apr 2020 17:01:31 +0000 (19:01 +0200)
commita42ca74fa30227e2f89a619332557cf093a937d5
treea3097e76897d8f8a0f054cab0736fd3cff80f8da
parentb8f704d2190125a7750b50cd9b67267b9c20fd43
bpo-40421: Add PyFrame_GetCode() function (GH-19757)

PyFrame_GetCode(frame): return a borrowed reference to the frame
code.

Replace frame->f_code with PyFrame_GetCode(frame) in most code,
except in frameobject.c, genobject.c and ceval.c.

Also add PyFrame_GetLineNumber() to the limited C API.
12 files changed:
Doc/c-api/init.rst
Doc/c-api/reflection.rst
Doc/whatsnew/3.9.rst
Include/pyframe.h
Misc/NEWS.d/next/C API/2020-04-28-15-47-58.bpo-40421.ZIzOV0.rst [new file with mode: 0644]
Modules/_lsprof.c
Modules/_tracemalloc.c
Objects/frameobject.c
Objects/typeobject.c
Python/_warnings.c
Python/import.c
Python/traceback.c