bpo-40268: Remove a few pycore_pystate.h includes (GH-19510)

This commit is contained in:
Victor Stinner 2020-04-14 17:52:15 +02:00 committed by GitHub
parent e1945307d3
commit e5014be049
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 78 additions and 86 deletions

View 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"

View 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"

View 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"

View 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()

View File

@ -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;

View 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>

View 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() */

View 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

View 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"

View 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"

View 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"

View 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)

View 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)

View 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? */

View 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"

View 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"

View 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. */

View 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"

View 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"

View 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"

View 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"

View File

@ -3,7 +3,6 @@
#include "Python.h"
#include "pycore_object.h"
#include "pycore_pymem.h"
#include "pycore_pystate.h"
typedef struct {
PyObject_HEAD

View 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"

View 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>

View 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 */

View 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;

View 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"

View 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;
}

View 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 */

View 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 *

View 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"

View 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"

View 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"

View 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>

View 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"

View File

@ -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 */

View 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>

View 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"

View 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__);

View 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"

View 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>

View 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"

View 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"

View 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

View 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"
/*

View 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"

View 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

View 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" {

View 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()

View 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"

View 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"
/* --------------------------------------------------------------------------

View File

@ -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"

View 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"

View 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"

View 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

View File

@ -2,7 +2,6 @@
/* Traceback implementation */
#include "Python.h"
#include "pycore_pystate.h"
#include "code.h"
#include "frameobject.h"