summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-04-14 15:52:15 (GMT)
committerGitHub <noreply@github.com>2020-04-14 15:52:15 (GMT)
commite5014be0497d06d78343623588a80f491a6f7b74 (patch)
treea8bbd18a39f6567115adb3089d1d9758c3e4690d /Python
parente1945307d36849f8be8937144cf3dd6ebab6274c (diff)
downloadcpython-e5014be0497d06d78343623588a80f491a6f7b74.zip
cpython-e5014be0497d06d78343623588a80f491a6f7b74.tar.gz
cpython-e5014be0497d06d78343623588a80f491a6f7b74.tar.bz2
bpo-40268: Remove a few pycore_pystate.h includes (GH-19510)
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c2
-rw-r--r--Python/bltinmodule.c2
-rw-r--r--Python/ceval.c4
-rw-r--r--Python/codecs.c4
-rw-r--r--Python/context.c3
-rw-r--r--Python/errors.c2
-rw-r--r--Python/frozenmain.c2
-rw-r--r--Python/hamt.c3
-rw-r--r--Python/import.c4
-rw-r--r--Python/initconfig.c14
-rw-r--r--Python/pathconfig.c4
-rw-r--r--Python/preconfig.c2
-rw-r--r--Python/pylifecycle.c4
-rw-r--r--Python/pystate.c2
-rw-r--r--Python/pythonrun.c3
-rw-r--r--Python/symtable.c2
-rw-r--r--Python/sysmodule.c3
-rw-r--r--Python/thread.c2
-rw-r--r--Python/traceback.c1
19 files changed, 32 insertions, 31 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 0236cab..f4ef0bb 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 8063c21..a9fc21f 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 fc720b4..16e2d0b 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 32cc110..0f18c27 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 e0338c9..00f25dd 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 a2fe52b..db00770 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 508721b..dd04d60 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 7299810..9924e33 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 042691d..8a2f9de 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 43e0ccb..201d930 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 aa1d6f8..1515926 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 db32875..531d8d0 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 ac0ea10..754e762 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 65d46a2..3c427c1 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 d1165e2..2466699 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 014570e..a3c5d65 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 6b3a1c3..79e5df0 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 bac0e69..1276103 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 2167e07..610c217 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"