From 384621c42f9102e31ba2c47feba144af09c989e5 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 22 Jun 2020 17:27:35 +0200 Subject: bpo-41078: Rename pycore_tupleobject.h to pycore_tuple.h (GH-21056) --- Include/internal/pycore_tuple.h | 20 ++++++++++++++++++++ Include/internal/pycore_tupleobject.h | 19 ------------------- Makefile.pre.in | 2 +- Modules/_functoolsmodule.c | 2 +- Modules/itertoolsmodule.c | 2 +- Objects/call.c | 14 +++++++------- Objects/codeobject.c | 4 ++-- Objects/descrobject.c | 8 ++++---- Objects/funcobject.c | 1 - Objects/listobject.c | 8 ++++---- Objects/rangeobject.c | 4 ++-- Objects/structseq.c | 4 ++-- PCbuild/pythoncore.vcxproj | 2 +- PCbuild/pythoncore.vcxproj.filters | 2 +- Python/bltinmodule.c | 7 +++---- Python/ceval.c | 18 +++++++++--------- Python/getargs.c | 2 +- Python/sysmodule.c | 16 ++++++++-------- 18 files changed, 67 insertions(+), 68 deletions(-) create mode 100644 Include/internal/pycore_tuple.h delete mode 100644 Include/internal/pycore_tupleobject.h diff --git a/Include/internal/pycore_tuple.h b/Include/internal/pycore_tuple.h new file mode 100644 index 0000000..5353e18 --- /dev/null +++ b/Include/internal/pycore_tuple.h @@ -0,0 +1,20 @@ +#ifndef Py_INTERNAL_TUPLE_H +#define Py_INTERNAL_TUPLE_H +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_BUILD_CORE +# error "this header requires Py_BUILD_CORE define" +#endif + +#include "tupleobject.h" /* _PyTuple_CAST() */ + +#define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item) + +PyAPI_FUNC(PyObject *) _PyTuple_FromArray(PyObject *const *, Py_ssize_t); + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERNAL_TUPLE_H */ diff --git a/Include/internal/pycore_tupleobject.h b/Include/internal/pycore_tupleobject.h deleted file mode 100644 index f95f16c..0000000 --- a/Include/internal/pycore_tupleobject.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef Py_INTERNAL_TUPLEOBJECT_H -#define Py_INTERNAL_TUPLEOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef Py_BUILD_CORE -# error "this header requires Py_BUILD_CORE define" -#endif - -#include "tupleobject.h" /* _PyTuple_CAST() */ - -#define _PyTuple_ITEMS(op) (_PyTuple_CAST(op)->ob_item) -PyAPI_FUNC(PyObject *) _PyTuple_FromArray(PyObject *const *, Py_ssize_t); - -#ifdef __cplusplus -} -#endif -#endif /* !Py_INTERNAL_TUPLEOBJECT_H */ diff --git a/Makefile.pre.in b/Makefile.pre.in index 24dddcf..a52a97f 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -1120,7 +1120,7 @@ PYTHON_HEADERS= \ $(srcdir)/Include/internal/pycore_runtime.h \ $(srcdir)/Include/internal/pycore_sysmodule.h \ $(srcdir)/Include/internal/pycore_traceback.h \ - $(srcdir)/Include/internal/pycore_tupleobject.h \ + $(srcdir)/Include/internal/pycore_tuple.h \ $(srcdir)/Include/internal/pycore_warnings.h \ $(DTRACE_HEADERS) diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index f1ee23f..8120140 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,6 +1,6 @@ #include "Python.h" #include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include "structmember.h" // PyMemberDef /* _functools module written and maintained diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 3f2f716..3809dc3 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -1,7 +1,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_tupleobject.h" +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include // offsetof() /* Itertools module written and maintained diff --git a/Objects/call.c b/Objects/call.c index 61426c7..30fa14c 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -1,11 +1,11 @@ #include "Python.h" -#include "pycore_call.h" -#include "pycore_ceval.h" // _PyEval_EvalFrame() -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" -#include "frameobject.h" +#include "pycore_call.h" // _PyObject_CallNoArgTstate() +#include "pycore_ceval.h" // _PyEval_EvalFrame() +#include "pycore_object.h" // _PyObject_GC_TRACK() +#include "pycore_pyerrors.h" // _PyErr_Occurred() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_tuple.h" // _PyTuple_ITEMS() +#include "frameobject.h" // _PyFrame_New_NoTrack() static PyObject *const * diff --git a/Objects/codeobject.c b/Objects/codeobject.c index cb4fb68..49011db 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -4,10 +4,10 @@ #include "code.h" #include "opcode.h" #include "structmember.h" // PyMemberDef -#include "pycore_code.h" +#include "pycore_code.h" // _PyOpcache #include "pycore_interp.h" // PyInterpreterState.co_extra_freefuncs #include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_tupleobject.h" +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include "clinic/codeobject.c.h" /* Holder for co_extra information */ diff --git a/Objects/descrobject.c b/Objects/descrobject.c index fce9cdd..a8ce13c 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1,10 +1,10 @@ /* Descriptors -- a new, flexible way to describe attributes */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() -#include "pycore_object.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_object.h" // _PyObject_GC_UNTRACK() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include "structmember.h" // PyMemberDef _Py_IDENTIFIER(getattr); diff --git a/Objects/funcobject.c b/Objects/funcobject.c index bd24f67..09a1886 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" -#include "pycore_tupleobject.h" #include "code.h" #include "structmember.h" // PyMemberDef diff --git a/Objects/listobject.c b/Objects/listobject.c index 22cdbe3..261a0fd 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -1,10 +1,10 @@ /* List object implementation */ #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_object.h" -#include "pycore_tupleobject.h" -#include "pycore_accu.h" +#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_interp.h" // PyInterpreterState.list +#include "pycore_object.h" // _PyObject_GC_TRACK() +#include "pycore_tuple.h" // _PyTuple_FromArray() #ifdef STDC_HEADERS #include diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c index 751dbb9..ba6d425 100644 --- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1,8 +1,8 @@ /* Range object implementation */ #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_tupleobject.h" +#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include "structmember.h" // PyMemberDef /* Support objects whose length is > PY_SSIZE_T_MAX. diff --git a/Objects/structseq.c b/Objects/structseq.c index b17b1f9..bd20ce3 100644 --- a/Objects/structseq.c +++ b/Objects/structseq.c @@ -8,8 +8,8 @@ */ #include "Python.h" -#include "pycore_tupleobject.h" -#include "pycore_object.h" +#include "pycore_tuple.h" // _PyTuple_FromArray() +#include "pycore_object.h" // _PyObject_GC_TRACK() #include "structmember.h" // PyMemberDef static const char visible_length_key[] = "n_sequence_fields"; diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index fc99d77..0071475 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -191,7 +191,7 @@ - + diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters index 12f05ac..ddcdaf4 100644 --- a/PCbuild/pythoncore.vcxproj.filters +++ b/PCbuild/pythoncore.vcxproj.filters @@ -273,7 +273,7 @@ Include - + Include diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index c6ede1c..a582ccd 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -4,10 +4,9 @@ #include #include "ast.h" #undef Yield /* undefine macro conflicting with */ -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" +#include "pycore_pyerrors.h" // _PyErr_NoMemory() +#include "pycore_pystate.h" // _PyThreadState_GET() +#include "pycore_tuple.h" // _PyTuple_FromArray() _Py_IDENTIFIER(__builtins__); _Py_IDENTIFIER(__dict__); diff --git a/Python/ceval.c b/Python/ceval.c index 2bd7cb3..0386929 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -11,17 +11,17 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_call.h" -#include "pycore_ceval.h" -#include "pycore_code.h" -#include "pycore_initconfig.h" -#include "pycore_object.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" +#include "pycore_call.h" // _PyObject_FastCallDictTstate() +#include "pycore_ceval.h" // _PyEval_SignalAsyncExc() +#include "pycore_code.h" // _PyCode_InitOpcache() +#include "pycore_initconfig.h" // _PyStatus_OK() +#include "pycore_object.h" // _PyObject_GC_TRACK() +#include "pycore_pyerrors.h" // _PyErr_Fetch() +#include "pycore_pylifecycle.h" // _PyErr_Print() #include "pycore_pymem.h" // _PyMem_IsPtrFreed() #include "pycore_pystate.h" // _PyInterpreterState_GET() -#include "pycore_sysmodule.h" -#include "pycore_tupleobject.h" +#include "pycore_sysmodule.h" // _PySys_Audit() +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include "code.h" #include "dictobject.h" diff --git a/Python/getargs.c b/Python/getargs.c index aaf687a..c85ff6d 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -2,7 +2,7 @@ /* New getargs implementation */ #include "Python.h" -#include "pycore_tupleobject.h" +#include "pycore_tuple.h" // _PyTuple_ITEMS() #include #include diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 3e4115f..f3b5a6a 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -15,18 +15,18 @@ Data members: */ #include "Python.h" -#include "code.h" -#include "frameobject.h" // PyFrame_GetBack() #include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() -#include "pycore_initconfig.h" -#include "pycore_object.h" -#include "pycore_pathconfig.h" -#include "pycore_pyerrors.h" -#include "pycore_pylifecycle.h" +#include "pycore_initconfig.h" // _PyStatus_EXCEPTION() +#include "pycore_object.h" // _PyObject_IS_GC() +#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0() +#include "pycore_pyerrors.h" // _PyErr_Fetch() +#include "pycore_pylifecycle.h" // _PyErr_WriteUnraisableDefaultHook() #include "pycore_pymem.h" // _PyMem_SetDefaultAllocator() #include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" +#include "pycore_tuple.h" // _PyTuple_FromArray() +#include "code.h" +#include "frameobject.h" // PyFrame_GetBack() #include "pydtrace.h" #include "osdefs.h" // DELIM #include -- cgit v0.12