diff options
author | Victor Stinner <vstinner@python.org> | 2022-06-19 10:02:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-19 10:02:33 (GMT) |
commit | 27b989403356ccdd47545a93aeab8434e9c69f21 (patch) | |
tree | 731c6554ce03b81ed4fca91035ddad1efec632a6 /Python | |
parent | 2664d9aacf25aa18e1753e57f80f345ed9bd31e0 (diff) | |
download | cpython-27b989403356ccdd47545a93aeab8434e9c69f21.zip cpython-27b989403356ccdd47545a93aeab8434e9c69f21.tar.gz cpython-27b989403356ccdd47545a93aeab8434e9c69f21.tar.bz2 |
gh-93937, C API: Move PyFrame_GetBack() to Python.h (#93938)
Move the follow functions and type from frameobject.h to pyframe.h,
so the standard <Python.h> provide frame getter functions:
* PyFrame_Check()
* PyFrame_GetBack()
* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLasti()
* PyFrame_GetLocals()
* PyFrame_Type
Remove #include "frameobject.h" from many C files. It's no longer
needed.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/_warnings.c | 1 | ||||
-rw-r--r-- | Python/ceval.c | 1 | ||||
-rw-r--r-- | Python/frame.c | 2 | ||||
-rw-r--r-- | Python/suggestions.c | 1 | ||||
-rw-r--r-- | Python/sysmodule.c | 2 | ||||
-rw-r--r-- | Python/traceback.c | 3 |
6 files changed, 4 insertions, 6 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index 085ca45..601dae8 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -4,7 +4,6 @@ #include "pycore_long.h" // _PyLong_GetZero() #include "pycore_pyerrors.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "frameobject.h" // PyFrame_GetBack() #include "pycore_frame.h" #include "clinic/_warnings.c.h" diff --git a/Python/ceval.c b/Python/ceval.c index 44e4ffe..77f80b9 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -28,7 +28,6 @@ #include "pycore_dict.h" #include "dictobject.h" -#include "frameobject.h" #include "pycore_frame.h" #include "opcode.h" #include "pydtrace.h" diff --git a/Python/frame.c b/Python/frame.c index 3573f54..9eaf41d 100644 --- a/Python/frame.c +++ b/Python/frame.c @@ -3,7 +3,7 @@ #include "Python.h" #include "frameobject.h" -#include "pycore_code.h" // stats +#include "pycore_code.h" // stats #include "pycore_frame.h" #include "pycore_object.h" // _PyObject_GC_UNTRACK() #include "opcode.h" diff --git a/Python/suggestions.c b/Python/suggestions.c index b84acaa..c336ec8 100644 --- a/Python/suggestions.c +++ b/Python/suggestions.c @@ -1,5 +1,4 @@ #include "Python.h" -#include "frameobject.h" #include "pycore_frame.h" #include "pycore_pyerrors.h" diff --git a/Python/sysmodule.c b/Python/sysmodule.c index b9cae15..8a9a584 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -31,7 +31,7 @@ Data members: #include "pycore_structseq.h" // _PyStructSequence_InitType() #include "pycore_tuple.h" // _PyTuple_FromArray() -#include "frameobject.h" // PyFrame_GetBack() +#include "frameobject.h" // PyFrame_FastToLocalsWithError() #include "pydtrace.h" #include "osdefs.h" // DELIM #include "stdlib_module_names.h" // _Py_stdlib_module_names diff --git a/Python/traceback.c b/Python/traceback.c index e76c9aa..439689b 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -3,7 +3,6 @@ #include "Python.h" -#include "frameobject.h" // PyFrame_GetBack() #include "pycore_ast.h" // asdl_seq_* #include "pycore_call.h" // _PyObject_CallMethodFormat() #include "pycore_compile.h" // _PyAST_Optimize @@ -15,7 +14,9 @@ #include "pycore_pyerrors.h" // _PyErr_Fetch() #include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_traceback.h" // EXCEPTION_TB_HEADER + #include "../Parser/pegen.h" // _PyPegen_byte_offset_to_character_offset() +#include "frameobject.h" // PyFrame_New() #include "structmember.h" // PyMemberDef #include "osdefs.h" // SEP #ifdef HAVE_FCNTL_H |