]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40268: Remove a few pycore_pystate.h includes (GH-19510)
authorVictor Stinner <vstinner@python.org>
Tue, 14 Apr 2020 15:52:15 +0000 (17:52 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Apr 2020 15:52:15 +0000 (17:52 +0200)
56 files changed:
Modules/_functoolsmodule.c
Modules/_io/bufferedio.c
Modules/_io/textio.c
Modules/_threadmodule.c
Modules/gcmodule.c
Modules/getpath.c
Modules/main.c
Modules/posixmodule.c
Modules/signalmodule.c
Objects/abstract.c
Objects/call.c
Objects/cellobject.c
Objects/classobject.c
Objects/descrobject.c
Objects/dictobject.c
Objects/exceptions.c
Objects/fileobject.c
Objects/frameobject.c
Objects/funcobject.c
Objects/genobject.c
Objects/interpreteridobject.c
Objects/iterobject.c
Objects/listobject.c
Objects/memoryobject.c
Objects/methodobject.c
Objects/moduleobject.c
Objects/object.c
Objects/odictobject.c
Objects/setobject.c
Objects/sliceobject.c
Objects/tupleobject.c
Objects/typeobject.c
Objects/unicodeobject.c
PC/getpathp.c
Parser/listnode.c
Parser/myreadline.c
Programs/_testembed.c
Python/_warnings.c
Python/bltinmodule.c
Python/ceval.c
Python/codecs.c
Python/context.c
Python/errors.c
Python/frozenmain.c
Python/hamt.c
Python/import.c
Python/initconfig.c
Python/pathconfig.c
Python/preconfig.c
Python/pylifecycle.c
Python/pystate.c
Python/pythonrun.c
Python/symtable.c
Python/sysmodule.c
Python/thread.c
Python/traceback.c

index 2f1b47a5b061d053cf5e1da363a994fe637cb024..d9536bb4e92d01717a5afc6bad684883bc8212d6 100644 (file)
@@ -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"
 
index 6e76db42c3a602fb19fc75abcddde6d9ff335ace..4ec42eb01082cc550600ced5b32166cd9c7a50d2 100644 (file)
@@ -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"
index 95b023d17908e7a2d339e50755112ffe73d84388..9e33c1ed17b0fe9ffe95029c6897511f09fcb425 100644 (file)
@@ -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"
 
index 5636140dde4d30797291b041d7774800a2284239..8ff06698a807c1f2221f640f96a9a6e340a8d0f8 100644 (file)
@@ -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()
 
index 17541824761a13234d41b37e4fd12448c214586d..281ab33e06523e7c398a1f0a82ab5b4d3ad02767 100644 (file)
 #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;
 
index e97ea8b30799d1cb6de56186a6719b1ca15ddc58..1dd8dd0134e7c627263a90a13d8a87982e9ef5fa 100644 (file)
@@ -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>
index fb24c6c6c28923e7475207a740235c672bf2954d..fa9c6b4eb9418860e739a724eb5022d749d79e76 100644 (file)
@@ -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() */
index 2d603d14e8df5756fc5b26c08fc5256ba6fdf8b5..692dda314b304ff54f13935ae506556261ad51a0 100644 (file)
@@ -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
index ceb986bddcbd3a1dc9834a13af7348b70e7d3945..69d69ace28ebb0ffd35f93fb807a8f3147f842b3 100644 (file)
@@ -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"
index 7e1e51b4c87c2d60c2b81d1ad2e1e753274304e7..8e22dfeca99b4490f63b6fb8416273c0523132b9 100644 (file)
@@ -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"
index 08614143246091849cefcb2e724cad71eb71cdfb..61426c7e09e4e71b2bad982b4988b61da926527f 100644 (file)
@@ -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"
 
index e97feefbf6d045c2c49e98e1412cd22399d0eb43..6efae626bf5b7d2b363e5584d1c36aec335cedb1 100644 (file)
@@ -3,7 +3,6 @@
 #include "Python.h"
 #include "pycore_object.h"
 #include "pycore_pymem.h"
-#include "pycore_pystate.h"
 
 PyObject *
 PyCell_New(PyObject *obj)
index 999b91c0a2dc8990a16d5bfcd70f821e378d6c4a..ce4bf7b5ff97ce88638657c1bafc895e04eed9b4 100644 (file)
@@ -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)
index 5fab222b82cae95d9ec0ffe1cde25ba9c4e1e5d2..fe7ba79770a6ad4e4e4e93f0f35604f987a63d86 100644 (file)
@@ -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? */
 
index 60660adf897c35982b6fe40f3d6fcbf89d3f7718..8f9d4e7b7314042e20ae14d10f9d2588372c71f3 100644 (file)
@@ -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"
index dad177a1ab6060407da38d9c896f357a9b71b99c..cb661f84ff2de64199a0dd4b48e876c8735a092d 100644 (file)
@@ -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"
 
index b8ec56e994ca6608f87f57485d6edb9d10de5256..1c6ecaf82c24eff0a9b68ddff6f1fedd6ec205e0 100644 (file)
@@ -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. */
index 340267bd4790794db9eb0fc9c8045dc33ea44501..3c140acad7ea6b51fec3ae4809a369d17ad3ab8a 100644 (file)
@@ -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"
index 3ec949d573bf5a23400e3a1961dfcf24fac64807..af6766fbd7a9f71f2041bdd422c6e6d3d545e6e8 100644 (file)
@@ -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"
index d3455f8dcd7923ccbe59f6c059802efa33703dc0..b1a749d140e824873488b78301a1abd2d8d8e625 100644 (file)
@@ -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"
index 84fd85845207a3145508d4b12d7f72b467e7baca..a250293a4727755ecfa8b1839eed44c113f5930b 100644 (file)
@@ -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"
 
 
index fe1de7e211c5d6b1b702677b4a9365b23ad8227f..51104fbe9695fdfd055e9e93189222da401e66ef 100644 (file)
@@ -3,7 +3,6 @@
 #include "Python.h"
 #include "pycore_object.h"
 #include "pycore_pymem.h"
-#include "pycore_pystate.h"
 
 typedef struct {
     PyObject_HEAD
index 7058fe4396eec4ce9a7a9530cd591ec5aac656b1..7d2f006617ba50e165847544eb1b464e20c8c2ce 100644 (file)
@@ -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"
 
index da06338017caebd598b8d0eb0bbe300324702bfc..4340f0675f163f2edf673b790481ade1a94d9caa 100644 (file)
@@ -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>
 
index 44ae00f7e00236ef9cd2d4e2d3c138e1ee91d107..4b4927db8209435b9e39071645b726a1e5e64edf 100644 (file)
@@ -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 */
index 1f419ad08317edcee2d3c1a0ae1a83e6d206e5b2..499ce09ae6b5b83e49313fbf0761d13d49a149a0 100644 (file)
@@ -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;
index ef4ba997de427334c24ebbc67b570067fc4b6eeb..4fa488e8d08b610dec905debc2c110f24626515f 100644 (file)
@@ -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"
 
index 220ae92ec929621ce97d8cebd9b96fa597ed695b..2fcaa478765136b2ce790a318155218a9fa3509e 100644 (file)
@@ -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;
 }
 
index 232ba6d97a07011ae63172c50e9d73b31c996893..0b15bedeb4ff37f65335f59b6d8d4da971c688f2 100644 (file)
@@ -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 */
index 4fd216388fdfde79829420421e3d0e7373a6cc93..0a5f00dbe0a3989b5969a5938057d37d219b150b 100644 (file)
@@ -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 *
index 110c0925ccd944230d62d543fd2a9f71edd214cb..b65b8abc2806df0384e96c2ac79a35df66ad7c45 100644 (file)
@@ -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"
index 209c6a554eedd9b9df9ba91fc1e9ca0fa0f08588..47766bf6fbbbfbf860ff46c9a5012f7d5c2a6e04 100644 (file)
@@ -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"
 
index 28ec8f10dcb3d29536f70b6e5f69687abb26cbf9..51775df199d1ea75bd565a27409d942ca733b6c9 100644 (file)
@@ -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"
 
index aa820e57a9cb2b9debbbb2e761f72edf9335aafe..24a9323e6e67e9595e4b8879aa95899289dd66e6 100644 (file)
@@ -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>
 
index 3bcc03e93526a92d31c3fa6d38e422b1a801b2bf..c806b98e48c35ed6dacc2699d76f84e1a2fd73e7 100644 (file)
@@ -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"
 
index 43e5583b8bcc431818f8ca64e566a7314a67aa37..7da8ea837806570efcffb7f951155c637d5321cc 100644 (file)
 */
 
 #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 */
 
 
index 900a4b1d427a6b8ab54601063129b4e9046a52e6..da3e7861d1e80b4b5c44539dcdf4c254d4101081 100644 (file)
@@ -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>
index 0236cabdf11c2665a09960f1e33fe01012ec22e6..f4ef0bb4b121432bd12b4116f11df79d7a6843fc 100644 (file)
@@ -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"
 
index 8063c2186d3e6789566140a59f0e5d1305f0bfec..a9fc21f1087748332dc9e55deaf2feb292fe9818 100644 (file)
@@ -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__);
index fc720b4ba403a720e1967b8c21a74cc24b0bfcc1..16e2d0b1fbea9564a5569c9b55c8bea6926bd3fb 100644 (file)
@@ -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"
 
index 32cc110d8ec136c567ff50b0ecfeb10bd0e0c0a7..0f18c27e5fe461c32ba5f4b15a9c3c3475f957fd 100644 (file)
@@ -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>
 
index e0338c97e1873a31a7b0e15c508529d42ebf0970..00f25ddab41d1c72fa8362bdced9e1c03856b43a 100644 (file)
@@ -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"
 
 
index a2fe52b812006f715183098848ac00a535174d0c..db007709d263ea3068699842b7e8bbbd97c76dd2 100644 (file)
@@ -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"
 
index 508721b85590286faaa7c26ce4fdfd46e37143f6..dd04d609d24f9315f910d96f327c0210c70ab634 100644 (file)
@@ -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
index 729981033f4a7b882a2142dc375c22758e8c0349..9924e3351243e18a52329d9c65b8a10f4a92b40c 100644 (file)
@@ -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"
 
 /*
index 042691d30b0de9382e7d9ca3d54c08fb4845edaa..8a2f9de066a6829683ef00dae93c9e15faec7be7 100644 (file)
@@ -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"
index 43e0ccb09b7c260e8742901d025344f1c900858c..201d930f7d8d20c96ad483b0c1efef59dcc3ddc7 100644 (file)
@@ -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
 
index aa1d6f8139bcc34400b3353dad4388e8fa460715..1515926531a1cfcbe642be873101e9301e98efe6 100644 (file)
@@ -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" {
index db328759c13a12e8853f89ceaf1c694a3809c95b..531d8d0df350446285e85baca2fe187678a9bee2 100644 (file)
@@ -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()
 
 
index ac0ea107bcf90696840077383c07e06694c3e011..754e7620a0cc001decd36c6829d98dca6e30f0d6 100644 (file)
@@ -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"
index 65d46a2bb42489e2d31ef5801e16a40d211a72ba..3c427c12107148089cb550e64cc94132088df958 100644 (file)
@@ -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"
 
 /* --------------------------------------------------------------------------
index d1165e2b4d2f32259620410568041e292c9ef4f1..246669994c4dd0eeb0f231af240250c9371dcb41 100644 (file)
 
 #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"
index 014570e6ef78f36e684283a38ba0d1416dfa0c70..a3c5d650d1edc6ef3137a1458f0ec277b5f3b718 100644 (file)
@@ -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"
index 6b3a1c38b9d9b902b80d0779fdfc08cd9989e1fd..79e5df06d30373b29c710f4b841102d81fc4011c 100644 (file)
@@ -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"
index bac0e6992ae0286825dacb68abb67d2f6f170db6..127610318663d170bc83be11e54a80cebf00e744 100644 (file)
@@ -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
index 2167e07a9b85df62c04e92aa44f28afa7370d802..610c2172ef833ca383b1c00fbf227a7d0e1c827d 100644 (file)
@@ -2,7 +2,6 @@
 /* Traceback implementation */
 
 #include "Python.h"
-#include "pycore_pystate.h"
 
 #include "code.h"
 #include "frameobject.h"