bpo-40268: Include explicitly pycore_interp.h (GH-19505)

pycore_pystate.h no longer includes pycore_interp.h:
it's now included explicitly in files accessing PyInterpreterState.
This commit is contained in:
Victor Stinner 2020-04-14 14:26:24 +02:00 committed by GitHub
parent 8ef875028a
commit 4a3fe08353
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 31 additions and 13 deletions

View File

@ -13,7 +13,7 @@ struct pyruntimestate;
struct _ceval_runtime_state; struct _ceval_runtime_state;
struct _frame; struct _frame;
#include "pycore_pystate.h" /* PyInterpreterState.eval_frame */ #include "pycore_interp.h" /* PyInterpreterState.eval_frame */
extern void _Py_FinishPendingCalls(PyThreadState *tstate); extern void _Py_FinishPendingCalls(PyThreadState *tstate);
extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *); extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *);
@ -50,7 +50,7 @@ extern PyObject *_PyEval_EvalCode(
PyObject *kwdefs, PyObject *closure, PyObject *kwdefs, PyObject *closure,
PyObject *name, PyObject *qualname); PyObject *name, PyObject *qualname);
extern int _PyEval_ThreadsInitialized(_PyRuntimeState *runtime); extern int _PyEval_ThreadsInitialized(struct pyruntimestate *runtime);
extern PyStatus _PyEval_InitGIL(PyThreadState *tstate); extern PyStatus _PyEval_InitGIL(PyThreadState *tstate);
extern void _PyEval_FiniGIL(PyThreadState *tstate); extern void _PyEval_FiniGIL(PyThreadState *tstate);

View File

@ -8,7 +8,9 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define" # error "this header requires Py_BUILD_CORE define"
#endif #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) _PyType_CheckConsistency(PyTypeObject *type);
PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content); PyAPI_FUNC(int) _PyDict_CheckConsistency(PyObject *mp, int check_content);

View File

@ -8,8 +8,7 @@ extern "C" {
# error "this header requires Py_BUILD_CORE define" # error "this header requires Py_BUILD_CORE define"
#endif #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. /* Check if the current thread is the main thread.

View File

@ -4,9 +4,10 @@
#include "Python.h" #include "Python.h"
#include "pycore_pylifecycle.h" #include "pycore_pylifecycle.h"
#include "pycore_interp.h" // _PyInterpreterState.num_threads
#include "pycore_pystate.h" #include "pycore_pystate.h"
#include "structmember.h" /* offsetof */
#include "pythread.h" #include "pythread.h"
#include <stddef.h> // offsetof()
static PyObject *ThreadError; static PyObject *ThreadError;
static PyObject *str_dict; static PyObject *str_dict;

View File

@ -2,6 +2,7 @@
#include "Python.h" #include "Python.h"
#include "pycore_initconfig.h" #include "pycore_initconfig.h"
#include "pycore_interp.h" // _PyInterpreterState.sysdict
#include "pycore_pathconfig.h" #include "pycore_pathconfig.h"
#include "pycore_pylifecycle.h" #include "pycore_pylifecycle.h"
#include "pycore_pymem.h" #include "pycore_pymem.h"

View File

@ -5,7 +5,8 @@
#include "opcode.h" #include "opcode.h"
#include "structmember.h" #include "structmember.h"
#include "pycore_code.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 "pycore_tupleobject.h"
#include "clinic/codeobject.c.h" #include "clinic/codeobject.c.h"

View File

@ -2,6 +2,7 @@
#include "Python.h" #include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check() #include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_interp.h" // _PyInterpreterState_LookUpID()
#include "pycore_pystate.h" #include "pycore_pystate.h"
#include "interpreteridobject.h" #include "interpreteridobject.h"

View File

@ -3,7 +3,8 @@
/* XXX The functional organization of this file is terrible */ /* XXX The functional organization of this file is terrible */
#include "Python.h" #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 "longintrepr.h"
#include <float.h> #include <float.h>

View File

@ -2,6 +2,7 @@
/* Module object implementation */ /* Module object implementation */
#include "Python.h" #include "Python.h"
#include "pycore_interp.h" // PyInterpreterState.importlib
#include "pycore_pystate.h" #include "pycore_pystate.h"
#include "structmember.h" #include "structmember.h"

View File

@ -2,7 +2,8 @@
/* List a node on a file */ /* List a node on a file */
#include "Python.h" #include "Python.h"
#include "pycore_pystate.h" #include "pycore_interp.h" // PyInterpreterState.parser
#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE
#include "token.h" #include "token.h"
#include "node.h" #include "node.h"

View File

@ -1,5 +1,6 @@
#include "Python.h" #include "Python.h"
#include "pycore_initconfig.h" #include "pycore_initconfig.h"
#include "pycore_interp.h" // PyInterpreterState.warnings
#include "pycore_pyerrors.h" #include "pycore_pyerrors.h"
#include "pycore_pystate.h" #include "pycore_pystate.h"
#include "frameobject.h" #include "frameobject.h"

View File

@ -9,6 +9,7 @@ Copyright (c) Corporation for National Research Initiatives.
------------------------------------------------------------------------ */ ------------------------------------------------------------------------ */
#include "Python.h" #include "Python.h"
#include "pycore_interp.h" // PyInterpreterState.codec_search_path
#include "pycore_pystate.h" #include "pycore_pystate.h"
#include "ucnhash.h" #include "ucnhash.h"
#include <ctype.h> #include <ctype.h>

View File

@ -2,6 +2,7 @@
/* Support for dynamic loading of extension modules */ /* Support for dynamic loading of extension modules */
#include "Python.h" #include "Python.h"
#include "pycore_interp.h" // _PyInterpreterState.dlopenflags
#include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE() #include "pycore_pystate.h" // _PyInterpreterState_GET_UNSAFE()
#include "importdl.h" #include "importdl.h"

View File

@ -9,6 +9,7 @@
#include "pycore_pyhash.h" #include "pycore_pyhash.h"
#include "pycore_pylifecycle.h" #include "pycore_pylifecycle.h"
#include "pycore_pymem.h" #include "pycore_pymem.h"
#include "pycore_interp.h" // _PyInterpreterState_ClearModules()
#include "pycore_pystate.h" #include "pycore_pystate.h"
#include "pycore_sysmodule.h" #include "pycore_sysmodule.h"
#include "errcode.h" #include "errcode.h"

View File

@ -3,6 +3,7 @@
#include "pycore_fileutils.h" #include "pycore_fileutils.h"
#include "pycore_getopt.h" #include "pycore_getopt.h"
#include "pycore_initconfig.h" #include "pycore_initconfig.h"
#include "pycore_interp.h" // _PyInterpreterState.runtime
#include "pycore_pathconfig.h" #include "pycore_pathconfig.h"
#include "pycore_pyerrors.h" #include "pycore_pyerrors.h"
#include "pycore_pylifecycle.h" #include "pycore_pylifecycle.h"

View File

@ -1,8 +1,9 @@
#include "Python.h" #include "Python.h"
#include "pycore_initconfig.h"
#include "pycore_getopt.h" #include "pycore_getopt.h"
#include "pycore_pystate.h" /* _PyRuntime_Initialize() */ #include "pycore_initconfig.h"
#include <locale.h> /* setlocale() */ #include "pycore_pymem.h" // _PyMem_GetAllocatorName()
#include "pycore_pystate.h" // _PyRuntime_Initialize()
#include <locale.h> // setlocale()
#define DECODE_LOCALE_ERR(NAME, LEN) \ #define DECODE_LOCALE_ERR(NAME, LEN) \

View File

@ -17,7 +17,9 @@ Data members:
#include "Python.h" #include "Python.h"
#include "code.h" #include "code.h"
#include "frameobject.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_initconfig.h"
#include "pycore_pathconfig.h" #include "pycore_pathconfig.h"
#include "pycore_pyerrors.h" #include "pycore_pyerrors.h"

View File

@ -1,3 +1,4 @@
#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize
/* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */ /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */
/* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */ /* Fast NonRecursiveMutex support by Yakov Markovitch, markovitch@iso.ru */

View File

@ -1,3 +1,4 @@
#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize
/* Posix threads interface */ /* Posix threads interface */