diff options
56 files changed, 78 insertions, 86 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 2f1b47a5b0..d9536bb4e9 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -1,6 +1,6 @@ #include "Python.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "structmember.h" diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 6e76db42c3..4ec42eb010 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -10,7 +10,6 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" #include "pycore_object.h" -#include "pycore_pystate.h" #include "structmember.h" #include "pythread.h" #include "_iomodule.h" diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c index 95b023d179..9e33c1ed17 100644 --- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -8,8 +8,9 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" +#include "pycore_interp.h" // PyInterpreterState.fs_codec #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "structmember.h" #include "_iomodule.h" diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c index 5636140dde..8ff06698a8 100644 --- a/Modules/_threadmodule.c +++ b/Modules/_threadmodule.c @@ -5,7 +5,7 @@ #include "Python.h" #include "pycore_pylifecycle.h" #include "pycore_interp.h" // _PyInterpreterState.num_threads -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_Init() #include "pythread.h" #include <stddef.h> // offsetof() diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c index 1754182476..281ab33e06 100644 --- a/Modules/gcmodule.c +++ b/Modules/gcmodule.c @@ -26,13 +26,14 @@ #include "Python.h" #include "pycore_context.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // PyInterpreterState.gc #include "pycore_object.h" #include "pycore_pyerrors.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_pymem.h" -#include "pycore_pystate.h" -#include "frameobject.h" /* for PyFrame_ClearFreeList */ +#include "frameobject.h" // PyFrame_ClearFreeList #include "pydtrace.h" -#include "pytime.h" /* for _PyTime_GetMonotonicClock() */ +#include "pytime.h" // _PyTime_GetMonotonicClock() typedef struct _gc_runtime_state GCState; diff --git a/Modules/getpath.c b/Modules/getpath.c index e97ea8b307..1dd8dd0134 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c @@ -1,11 +1,10 @@ /* Return the initial module search path. */ #include "Python.h" -#include "pycore_initconfig.h" -#include "osdefs.h" #include "pycore_fileutils.h" +#include "pycore_initconfig.h" #include "pycore_pathconfig.h" -#include "pycore_pystate.h" +#include "osdefs.h" #include <sys/types.h> #include <string.h> diff --git a/Modules/main.c b/Modules/main.c index fb24c6c6c2..fa9c6b4eb9 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -6,7 +6,7 @@ #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() /* Includes for exit_sigint() */ #include <stdio.h> /* perror() */ diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 2d603d14e8..692dda314b 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -37,7 +37,7 @@ #include "pycore_ceval.h" /* _PyEval_ReInitThreads() */ #include "pycore_import.h" /* _PyImport_ReInitLock() */ -#include "pycore_pystate.h" /* _PyRuntime */ +#include "pycore_pystate.h" /* _PyInterpreterState_GET() */ #include "pythread.h" #include "structmember.h" #ifndef MS_WINDOWS diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index ceb986bddc..69d69ace28 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -8,7 +8,7 @@ #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #ifndef MS_WINDOWS #include "posixmodule.h" diff --git a/Objects/abstract.c b/Objects/abstract.c index 7e1e51b4c8..8e22dfeca9 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -4,7 +4,7 @@ #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include <ctype.h> #include "structmember.h" /* we need the offsetof() macro from there */ #include "longintrepr.h" diff --git a/Objects/call.c b/Objects/call.c index 0861414324..61426c7e09 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -1,9 +1,9 @@ #include "Python.h" #include "pycore_call.h" -#include "pycore_ceval.h" /* _PyEval_EvalFrame() */ +#include "pycore_ceval.h" // _PyEval_EvalFrame() #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "frameobject.h" diff --git a/Objects/cellobject.c b/Objects/cellobject.c index e97feefbf6..6efae626bf 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" PyObject * PyCell_New(PyObject *obj) diff --git a/Objects/classobject.c b/Objects/classobject.c index 999b91c0a2..ce4bf7b5ff 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -4,7 +4,7 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" #define TP_DESCR_GET(t) ((t)->tp_descr_get) diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 5fab222b82..fe7ba79770 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1,9 +1,9 @@ /* Descriptors -- a new, flexible way to describe attributes */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "structmember.h" /* Why is this not included in Python.h? */ diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 60660adf89..8f9d4e7b73 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -111,10 +111,11 @@ converting the dict to the combined table. #define PyDict_MINSIZE 8 #include "Python.h" +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "dict-common.h" -#include "stringlib/eq.h" /* to get unicode_eq() */ +#include "stringlib/eq.h" // unicode_eq() /*[clinic input] class dict "PyDictObject *" "&PyDict_Type" diff --git a/Objects/exceptions.c b/Objects/exceptions.c index dad177a1ab..cb661f84ff 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -9,7 +9,6 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "structmember.h" #include "osdefs.h" diff --git a/Objects/fileobject.c b/Objects/fileobject.c index b8ec56e994..1c6ecaf82c 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -2,7 +2,7 @@ #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_runtime.h" // _PyRuntime #if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER) /* clang MemorySanitizer doesn't yet understand getc_unlocked. */ diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 340267bd47..3c140acad7 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c @@ -2,7 +2,7 @@ #include "Python.h" #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() #include "code.h" #include "frameobject.h" diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 3ec949d573..af6766fbd7 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -4,7 +4,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "pycore_tupleobject.h" #include "code.h" #include "structmember.h" diff --git a/Objects/genobject.c b/Objects/genobject.c index d3455f8dcd..b1a749d140 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -1,9 +1,9 @@ /* Generator object implementation */ #include "Python.h" -#include "pycore_ceval.h" /* _PyEval_EvalFrame() */ +#include "pycore_ceval.h" // _PyEval_EvalFrame() #include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "structmember.h" #include "opcode.h" diff --git a/Objects/interpreteridobject.c b/Objects/interpreteridobject.c index 84fd858452..a250293a47 100644 --- a/Objects/interpreteridobject.c +++ b/Objects/interpreteridobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_interp.h" // _PyInterpreterState_LookUpID() -#include "pycore_pystate.h" #include "interpreteridobject.h" diff --git a/Objects/iterobject.c b/Objects/iterobject.c index fe1de7e211..51104fbe96 100644 --- a/Objects/iterobject.c +++ b/Objects/iterobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" typedef struct { PyObject_HEAD diff --git a/Objects/listobject.c b/Objects/listobject.c index 7058fe4396..7d2f006617 100644 --- a/Objects/listobject.c +++ b/Objects/listobject.c @@ -3,7 +3,6 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" -#include "pycore_pystate.h" #include "pycore_tupleobject.h" #include "pycore_accu.h" diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index da06338017..4340f0675f 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -14,7 +14,6 @@ #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "pystrhex.h" #include <stddef.h> diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 44ae00f7e0..4b4927db82 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -2,11 +2,11 @@ /* Method object implementation */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" /* undefine macro trampoline to PyCFunction_NewEx */ diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 1f419ad083..499ce09ae6 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -3,7 +3,7 @@ #include "Python.h" #include "pycore_interp.h" // PyInterpreterState.importlib -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "structmember.h" static Py_ssize_t max_module_number; diff --git a/Objects/object.c b/Objects/object.c index ef4ba997de..4fa488e8d0 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -2,13 +2,13 @@ /* Generic object operations; and implementation of None */ #include "Python.h" -#include "pycore_ceval.h" // _Py_EnterRecursiveCall() +#include "pycore_ceval.h" // _Py_EnterRecursiveCall() #include "pycore_context.h" #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "interpreteridobject.h" diff --git a/Objects/odictobject.c b/Objects/odictobject.c index 220ae92ec9..2fcaa47876 100644 --- a/Objects/odictobject.c +++ b/Objects/odictobject.c @@ -466,7 +466,6 @@ later: #include "Python.h" #include "pycore_object.h" -#include "pycore_pystate.h" #include "structmember.h" #include "dict-common.h" #include <stddef.h> @@ -890,7 +889,7 @@ odict_inplace_or(PyObject *self, PyObject *other) if (mutablemapping_update_arg(self, other) < 0) { return NULL; } - Py_INCREF(self); + Py_INCREF(self); return self; } diff --git a/Objects/setobject.c b/Objects/setobject.c index 232ba6d97a..0b15bedeb4 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -32,8 +32,7 @@ */ #include "Python.h" -#include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_object.h" // _PyObject_GC_UNTRACK() #include "structmember.h" /* Object used as dummy key to fill deleted entries */ diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c index 4fd216388f..0a5f00dbe0 100644 --- a/Objects/sliceobject.c +++ b/Objects/sliceobject.c @@ -17,7 +17,6 @@ this type and there is exactly one in existence. #include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_object.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include "structmember.h" static PyObject * diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 110c0925cc..b65b8abc28 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -3,9 +3,9 @@ #include "Python.h" #include "pycore_abstract.h" // _PyIndex_Check() -#include "pycore_object.h" -#include "pycore_pystate.h" #include "pycore_accu.h" +#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED() +#include "pycore_object.h" /*[clinic input] class tuple "PyTupleObject *" "&PyTuple_Type" diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 209c6a554e..47766bf6fb 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5,7 +5,7 @@ #include "pycore_initconfig.h" #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "structmember.h" diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 28ec8f10dc..51775df199 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -40,14 +40,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PY_SSIZE_T_CLEAN #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_bytes_methods.h" #include "pycore_fileutils.h" #include "pycore_initconfig.h" +#include "pycore_interp.h" // PyInterpreterState.fs_codec #include "pycore_object.h" #include "pycore_pathconfig.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "ucnhash.h" #include "stringlib/eq.h" diff --git a/PC/getpathp.c b/PC/getpathp.c index aa820e57a9..24a9323e6e 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -82,7 +82,6 @@ #include "Python.h" #include "pycore_initconfig.h" /* PyStatus */ #include "pycore_pathconfig.h" /* _PyPathConfig */ -#include "pycore_pystate.h" #include "osdefs.h" #include <wchar.h> diff --git a/Parser/listnode.c b/Parser/listnode.c index 3bcc03e935..c806b98e48 100644 --- a/Parser/listnode.c +++ b/Parser/listnode.c @@ -2,8 +2,8 @@ /* List a node on a file */ #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.parser -#include "pycore_pystate.h" // _PyInterpreterState_GET +#include "pycore_interp.h" // PyInterpreterState.parser +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "token.h" #include "node.h" diff --git a/Parser/myreadline.c b/Parser/myreadline.c index 43e5583b8b..7da8ea8378 100644 --- a/Parser/myreadline.c +++ b/Parser/myreadline.c @@ -10,10 +10,10 @@ */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #ifdef MS_WINDOWS -#define WIN32_LEAN_AND_MEAN -#include "windows.h" +# define WIN32_LEAN_AND_MEAN +# include "windows.h" #endif /* MS_WINDOWS */ diff --git a/Programs/_testembed.c b/Programs/_testembed.c index 900a4b1d42..da3e7861d1 100644 --- a/Programs/_testembed.c +++ b/Programs/_testembed.c @@ -6,8 +6,8 @@ #undef NDEBUG #include <Python.h> -#include "pycore_initconfig.h" /* _PyConfig_InitCompatConfig() */ -#include "pycore_pystate.h" /* _PyRuntime */ +#include "pycore_initconfig.h" // _PyConfig_InitCompatConfig() +#include "pycore_runtime.h" // _PyRuntime #include <Python.h> #include "pythread.h" #include <inttypes.h> diff --git a/Python/_warnings.c b/Python/_warnings.c index 0236cabdf1..f4ef0bb4b1 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -2,7 +2,7 @@ #include "pycore_initconfig.h" #include "pycore_interp.h" // PyInterpreterState.warnings #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "frameobject.h" #include "clinic/_warnings.c.h" diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 8063c2186d..a9fc21f108 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -6,7 +6,7 @@ #undef Yield /* undefine macro conflicting with <winbase.h> */ #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" _Py_IDENTIFIER(__builtins__); diff --git a/Python/ceval.c b/Python/ceval.c index fc720b4ba4..16e2d0b1fb 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -10,7 +10,7 @@ #define PY_LOCAL_AGGRESSIVE #include "Python.h" -#include "pycore_abstract.h" // _PyIndex_Check() +#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_call.h" #include "pycore_ceval.h" #include "pycore_code.h" @@ -18,7 +18,7 @@ #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "pycore_tupleobject.h" diff --git a/Python/codecs.c b/Python/codecs.c index 32cc110d8e..0f18c27e5f 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -9,8 +9,8 @@ Copyright (c) Corporation for National Research Initiatives. ------------------------------------------------------------------------ */ #include "Python.h" -#include "pycore_interp.h" // PyInterpreterState.codec_search_path -#include "pycore_pystate.h" +#include "pycore_interp.h" // PyInterpreterState.codec_search_path +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "ucnhash.h" #include <ctype.h> diff --git a/Python/context.c b/Python/context.c index e0338c97e1..00f25ddab4 100644 --- a/Python/context.c +++ b/Python/context.c @@ -1,10 +1,11 @@ #include "Python.h" #include "pycore_context.h" +#include "pycore_gc.h" // _PyObject_GC_MAY_BE_TRACKED() #include "pycore_hamt.h" #include "pycore_object.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "structmember.h" diff --git a/Python/errors.c b/Python/errors.c index a2fe52b812..db007709d2 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -4,7 +4,7 @@ #include "Python.h" #include "pycore_initconfig.h" #include "pycore_pyerrors.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" #include "pycore_traceback.h" diff --git a/Python/frozenmain.c b/Python/frozenmain.c index 508721b855..dd04d609d2 100644 --- a/Python/frozenmain.c +++ b/Python/frozenmain.c @@ -2,7 +2,7 @@ /* Python interpreter main program for frozen scripts */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_runtime.h" // _PyRuntime_Initialize() #include <locale.h> #ifdef MS_WINDOWS diff --git a/Python/hamt.c b/Python/hamt.c index 729981033f..9924e33512 100644 --- a/Python/hamt.c +++ b/Python/hamt.c @@ -1,8 +1,7 @@ #include "Python.h" #include "pycore_hamt.h" -#include "pycore_object.h" -#include "pycore_pystate.h" +#include "pycore_object.h" // _PyObject_GC_TRACK() #include "structmember.h" /* diff --git a/Python/import.c b/Python/import.c index 042691d30b..8a2f9de066 100644 --- a/Python/import.c +++ b/Python/import.c @@ -9,8 +9,8 @@ #include "pycore_pyhash.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_interp.h" // _PyInterpreterState_ClearModules() -#include "pycore_pystate.h" +#include "pycore_interp.h" // _PyInterpreterState_ClearModules() +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "errcode.h" #include "marshal.h" diff --git a/Python/initconfig.c b/Python/initconfig.c index 43e0ccb09b..201d930f7d 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -1,25 +1,25 @@ #include "Python.h" -#include "osdefs.h" /* DELIM */ +#include "osdefs.h" // DELIM #include "pycore_fileutils.h" #include "pycore_getopt.h" #include "pycore_initconfig.h" -#include "pycore_interp.h" // _PyInterpreterState.runtime +#include "pycore_interp.h" // _PyInterpreterState.runtime #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" /* _PyRuntime */ -#include <locale.h> /* setlocale() */ +#include "pycore_pystate.h" // _PyThreadState_GET() +#include <locale.h> // setlocale() #ifdef HAVE_LANGINFO_H -# include <langinfo.h> /* nl_langinfo(CODESET) */ +# include <langinfo.h> // nl_langinfo(CODESET) #endif #if defined(MS_WINDOWS) || defined(__CYGWIN__) -# include <windows.h> /* GetACP() */ +# include <windows.h> // GetACP() # ifdef HAVE_IO_H # include <io.h> # endif # ifdef HAVE_FCNTL_H -# include <fcntl.h> /* O_BINARY */ +# include <fcntl.h> // O_BINARY # endif #endif diff --git a/Python/pathconfig.c b/Python/pathconfig.c index aa1d6f8139..1515926531 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -6,8 +6,10 @@ #include "pycore_fileutils.h" #include "pycore_pathconfig.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" #include <wchar.h> +#ifdef MS_WINDOWS +# include <windows.h> // GetFullPathNameW(), MAX_PATH +#endif #ifdef __cplusplus extern "C" { diff --git a/Python/preconfig.c b/Python/preconfig.c index db328759c1..531d8d0df3 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -2,7 +2,7 @@ #include "pycore_getopt.h" #include "pycore_initconfig.h" #include "pycore_pymem.h" // _PyMem_GetAllocatorName() -#include "pycore_pystate.h" // _PyRuntime_Initialize() +#include "pycore_runtime.h" // _PyRuntime_Initialize() #include <locale.h> // setlocale() diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index ac0ea107bc..754e7620a0 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -6,7 +6,7 @@ #undef Yield /* undefine macro conflicting with <winbase.h> */ #include "pycore_ceval.h" #include "pycore_context.h" -#include "pycore_import.h" /* _PyImport_FindBuiltin */ +#include "pycore_import.h" // _PyImport_Cleanup() #include "pycore_initconfig.h" #include "pycore_fileutils.h" #include "pycore_hamt.h" @@ -15,7 +15,7 @@ #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" #include "pycore_traceback.h" #include "grammar.h" diff --git a/Python/pystate.c b/Python/pystate.c index 65d46a2bb4..3c427c1210 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -7,7 +7,7 @@ #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_sysmodule.h" /* -------------------------------------------------------------------------- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index d1165e2b4d..246669994c 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -12,10 +12,11 @@ #include "Python-ast.h" #undef Yield /* undefine macro conflicting with <winbase.h> */ +#include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #include "pycore_sysmodule.h" #include "grammar.h" #include "node.h" diff --git a/Python/symtable.c b/Python/symtable.c index 014570e6ef..a3c5d650d1 100644 --- a/Python/symtable.c +++ b/Python/symtable.c @@ -1,5 +1,5 @@ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "symtable.h" #undef Yield /* undefine macro conflicting with <winbase.h> */ #include "structmember.h" diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 6b3a1c38b9..79e5df06d3 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -18,13 +18,12 @@ Data members: #include "code.h" #include "frameobject.h" #include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark() -#include "pycore_pystate.h" // _PyThreadState_GET() -#include "pycore_tupleobject.h" #include "pycore_initconfig.h" #include "pycore_pathconfig.h" #include "pycore_pyerrors.h" #include "pycore_pylifecycle.h" #include "pycore_pymem.h" +#include "pycore_pystate.h" // _PyThreadState_GET() #include "pycore_tupleobject.h" #include "pythread.h" #include "pydtrace.h" diff --git a/Python/thread.c b/Python/thread.c index bac0e6992a..1276103186 100644 --- a/Python/thread.c +++ b/Python/thread.c @@ -6,7 +6,7 @@ Stuff shared by all thread_*.h files is collected here. */ #include "Python.h" -#include "pycore_pystate.h" +#include "pycore_pystate.h" // _PyInterpreterState_GET() #ifndef _POSIX_THREADS /* This means pthreads are not implemented in libc headers, hence the macro diff --git a/Python/traceback.c b/Python/traceback.c index 2167e07a9b..610c2172ef 100644 --- a/Python/traceback.c +++ b/Python/traceback.c @@ -2,7 +2,6 @@ /* Traceback implementation */ #include "Python.h" -#include "pycore_pystate.h" #include "code.h" #include "frameobject.h" |