]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40268: Include explicitly pycore_interp.h (GH-19505)
authorVictor Stinner <vstinner@python.org>
Tue, 14 Apr 2020 12:26:24 +0000 (14:26 +0200)
committerGitHub <noreply@github.com>
Tue, 14 Apr 2020 12:26:24 +0000 (14:26 +0200)
pycore_pystate.h no longer includes pycore_interp.h:
it's now included explicitly in files accessing PyInterpreterState.

19 files changed:
Include/internal/pycore_ceval.h
Include/internal/pycore_object.h
Include/internal/pycore_pystate.h
Modules/_threadmodule.c
Modules/main.c
Objects/codeobject.c
Objects/interpreteridobject.c
Objects/longobject.c
Objects/moduleobject.c
Parser/listnode.c
Python/_warnings.c
Python/codecs.c
Python/dynload_shlib.c
Python/import.c
Python/initconfig.c
Python/preconfig.c
Python/sysmodule.c
Python/thread_nt.h
Python/thread_pthread.h

index 811aada3dcb1893e534f2df5396846411e305dd3..298018a872b1a116d397b435665146a09ddbe2bb 100644 (file)
@@ -13,7 +13,7 @@ struct pyruntimestate;
 struct _ceval_runtime_state;
 struct _frame;
 
-#include "pycore_pystate.h"   /* PyInterpreterState.eval_frame */
+#include "pycore_interp.h"   /* PyInterpreterState.eval_frame */
 
 extern void _Py_FinishPendingCalls(PyThreadState *tstate);
 extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *);
@@ -50,7 +50,7 @@ extern PyObject *_PyEval_EvalCode(
     PyObject *kwdefs, PyObject *closure,
     PyObject *name, PyObject *qualname);
 
-extern int _PyEval_ThreadsInitialized(_PyRuntimeState *runtime);
+extern int _PyEval_ThreadsInitialized(struct pyruntimestate *runtime);
 extern PyStatus _PyEval_InitGIL(PyThreadState *tstate);
 extern void _PyEval_FiniGIL(PyThreadState *tstate);
 
index 5c3d3cae235f47c67be0bab145762ce982dc7078..7c0f24ac07d7f722ffb8bb59b630091a495e4ffe 100644 (file)
@@ -8,7 +8,9 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_pystate.h"   /* PyInterpreterState.gc */
+#include "pycore_gc.h"         // _PyObject_GC_IS_TRACKED()
+#include "pycore_interp.h"     // PyInterpreterState.gc
+#include "pycore_pystate.h"    // _PyThreadState_GET()
 
 PyAPI_FUNC(int) _PyType_CheckConsistency(PyTypeObject *type);
 PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);
index 748aa63a43063f02587387dca2d7b042b3b4caf7..2e783781ada607132fb9946116c5c1af95aae186 100644 (file)
@@ -8,8 +8,7 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_interp.h"    /* PyInterpreterState */
-#include "pycore_runtime.h"   /* PyRuntimestate */
+#include "pycore_runtime.h"   /* PyRuntimeState */
 
 
 /* Check if the current thread is the main thread.
index e2bb14ec728b4b99181dcaca278be8eed19bac21..9853699771a7542a3cd1b49870dba175d9d3b843 100644 (file)
@@ -4,9 +4,10 @@
 
 #include "Python.h"
 #include "pycore_pylifecycle.h"
+#include "pycore_interp.h"       // _PyInterpreterState.num_threads
 #include "pycore_pystate.h"
-#include "structmember.h" /* offsetof */
 #include "pythread.h"
+#include <stddef.h>              // offsetof()
 
 static PyObject *ThreadError;
 static PyObject *str_dict;
index 00a0fc3ece4015e4af86ccfdc4846a0ea4a25acc..a9de70b6b09ead122f9bb23c7f9057ce40408407 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "Python.h"
 #include "pycore_initconfig.h"
+#include "pycore_interp.h"       // _PyInterpreterState.sysdict
 #include "pycore_pathconfig.h"
 #include "pycore_pylifecycle.h"
 #include "pycore_pymem.h"
index 1820d8c8a5688b5503a7a15083e5c89b2a4b7492..7cb72ceab4480c8a6a3da1f2ff68e502e2ad01f6 100644 (file)
@@ -5,7 +5,8 @@
 #include "opcode.h"
 #include "structmember.h"
 #include "pycore_code.h"
-#include "pycore_pystate.h"
+#include "pycore_interp.h"        // PyInterpreterState.co_extra_freefuncs
+#include "pycore_pystate.h"       // _PyInterpreterState_GET_UNSAFE()
 #include "pycore_tupleobject.h"
 #include "clinic/codeobject.c.h"
 
index 3f316873ed516df1f09577d1f65924fecac8abdf..84fd85845207a3145508d4b12d7f72b467e7baca 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "Python.h"
 #include "pycore_abstract.h"   // _PyIndex_Check()
+#include "pycore_interp.h"     // _PyInterpreterState_LookUpID()
 #include "pycore_pystate.h"
 #include "interpreteridobject.h"
 
index a66e1c49241afa7aaeb3e6e25a18635d9f4d2aee..a0bb6bc52be02b68e9d4b9022b96a757c3a37ede 100644 (file)
@@ -3,7 +3,8 @@
 /* XXX The functional organization of this file is terrible */
 
 #include "Python.h"
-#include "pycore_pystate.h"   /* _Py_IsMainInterpreter() */
+#include "pycore_interp.h"    // _PY_NSMALLPOSINTS
+#include "pycore_pystate.h"   // _Py_IsMainInterpreter()
 #include "longintrepr.h"
 
 #include <float.h>
index 30adc92acf660b9e3e61e141d6ebec21945eddfb..acb920a4c0714d95ba3a634c1b9df8730d742d86 100644 (file)
@@ -2,6 +2,7 @@
 /* Module object implementation */
 
 #include "Python.h"
+#include "pycore_interp.h"    // PyInterpreterState.importlib
 #include "pycore_pystate.h"
 #include "structmember.h"
 
index d431ae537e3b412ba4edacc0d881c7f72513d0ce..f53b265efe6cb4535ff624e23e11a6afeac02b09 100644 (file)
@@ -2,7 +2,8 @@
 /* List a node on a file */
 
 #include "Python.h"
-#include "pycore_pystate.h"
+#include "pycore_interp.h"   // PyInterpreterState.parser
+#include "pycore_pystate.h"  // _PyInterpreterState_GET_UNSAFE
 #include "token.h"
 #include "node.h"
 
index e4dfb7391eaf1d4e60c5acf90b74e2e9f5c74038..d005f12910b48f4d890ab3fbc266d6f2cfcff3a9 100644 (file)
@@ -1,5 +1,6 @@
 #include "Python.h"
 #include "pycore_initconfig.h"
+#include "pycore_interp.h"        // PyInterpreterState.warnings
 #include "pycore_pyerrors.h"
 #include "pycore_pystate.h"
 #include "frameobject.h"
index 7b35ded2edcd580daeca0d95ce47ea81dba74783..66919856ced8403bdef4e03c0879a082fced693e 100644 (file)
@@ -9,6 +9,7 @@ Copyright (c) Corporation for National Research Initiatives.
    ------------------------------------------------------------------------ */
 
 #include "Python.h"
+#include "pycore_interp.h"     // PyInterpreterState.codec_search_path
 #include "pycore_pystate.h"
 #include "ucnhash.h"
 #include <ctype.h>
index 360387113366f4d596248e7ab9675c1734ac51b1..223e0d03f680e891c4b3e0cb10f03e4b2ea7781a 100644 (file)
@@ -2,6 +2,7 @@
 /* Support for dynamic loading of extension modules */
 
 #include "Python.h"
+#include "pycore_interp.h"    // _PyInterpreterState.dlopenflags
 #include "pycore_pystate.h"   // _PyInterpreterState_GET_UNSAFE()
 #include "importdl.h"
 
index d79fa18e30898a9852247119df5e83420a72d6a4..3bf8fe0581ef04e75a00447605407958e096ac17 100644 (file)
@@ -9,6 +9,7 @@
 #include "pycore_pyhash.h"
 #include "pycore_pylifecycle.h"
 #include "pycore_pymem.h"
+#include "pycore_interp.h"       // _PyInterpreterState_ClearModules()
 #include "pycore_pystate.h"
 #include "pycore_sysmodule.h"
 #include "errcode.h"
index e63d6f64f33216d813beea091c62c39fb8de66ae..43e0ccb09b7c260e8742901d025344f1c900858c 100644 (file)
@@ -3,6 +3,7 @@
 #include "pycore_fileutils.h"
 #include "pycore_getopt.h"
 #include "pycore_initconfig.h"
+#include "pycore_interp.h"    // _PyInterpreterState.runtime
 #include "pycore_pathconfig.h"
 #include "pycore_pyerrors.h"
 #include "pycore_pylifecycle.h"
index 89a6227fa67218dc428eeb53815eb1fb82e6a3b8..db328759c13a12e8853f89ceaf1c694a3809c95b 100644 (file)
@@ -1,8 +1,9 @@
 #include "Python.h"
-#include "pycore_initconfig.h"
 #include "pycore_getopt.h"
-#include "pycore_pystate.h"   /* _PyRuntime_Initialize() */
-#include <locale.h>       /* setlocale() */
+#include "pycore_initconfig.h"
+#include "pycore_pymem.h"      // _PyMem_GetAllocatorName()
+#include "pycore_pystate.h"    // _PyRuntime_Initialize()
+#include <locale.h>            // setlocale()
 
 
 #define DECODE_LOCALE_ERR(NAME, LEN) \
index fd0a9c0bf576c0f039967ad1f6abd0a57b0b220d..814e4abad58e239621d6ab45ff4ec6363b11ce31 100644 (file)
@@ -17,7 +17,9 @@ Data members:
 #include "Python.h"
 #include "code.h"
 #include "frameobject.h"
-#include "pycore_ceval.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"
index 23d585cf9fa6c00f3038ef48a83a5b9fac236440..e4bd0f70581ee44ab02c780a592a203df4005d59 100644 (file)
@@ -1,3 +1,4 @@
+#include "pycore_interp.h"    // _PyInterpreterState.pythread_stacksize
 
 /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */
 /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */
index e3497e7d595b185e09fc7c79db1d82c2aaf26666..440d845312a7dd9168963ebd17c94b1031393208 100644 (file)
@@ -1,3 +1,4 @@
+#include "pycore_interp.h"    // _PyInterpreterState.pythread_stacksize
 
 /* Posix threads interface */