https://github.com/python/cpython/commit/a7411025c5152e638b01eef0f0f5a6bf9352b46d
commit: a7411025c5152e638b01eef0f0f5a6bf9352b46d
branch: main
author: Victor Stinner <vstin...@python.org>
committer: vstinner <vstin...@python.org>
date: 2025-03-19T23:13:25Z
summary:

gh-131238: Use pycore_interp_structs.h header (#131481)

Replace pycore_runtime_structs.h include with pycore_interp_structs.h
include in internal headers.

files:
M Include/internal/pycore_codecs.h
M Include/internal/pycore_fileutils.h
M Include/internal/pycore_gc.h
M Include/internal/pycore_import.h
M Include/internal/pycore_interp.h
M Include/internal/pycore_runtime.h
M Include/internal/pycore_time.h
M Include/internal/pycore_typeobject.h

diff --git a/Include/internal/pycore_codecs.h b/Include/internal/pycore_codecs.h
index 7c44a449270202..01b31d31998e53 100644
--- a/Include/internal/pycore_codecs.h
+++ b/Include/internal/pycore_codecs.h
@@ -8,8 +8,8 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
+#include "pycore_interp_structs.h" // struct codecs_state
 #include "pycore_lock.h"          // PyMutex
-#include "pycore_runtime_structs.h"    // struct codecs_state
 
 /* Initialize codecs-related state for the given interpreter, including
    registering the first codec search function. Must be called before any other
diff --git a/Include/internal/pycore_fileutils.h 
b/Include/internal/pycore_fileutils.h
index 1ef23588d85527..2c6d6daa01994e 100644
--- a/Include/internal/pycore_fileutils.h
+++ b/Include/internal/pycore_fileutils.h
@@ -9,7 +9,7 @@ extern "C" {
 #endif
 
 #include <locale.h>               // struct lconv
-#include "pycore_runtime_structs.h" // _Py_error_handler
+#include "pycore_interp_structs.h" // _Py_error_handler
 
 
 /* A routine to check if a file descriptor can be select()-ed. */
diff --git a/Include/internal/pycore_gc.h b/Include/internal/pycore_gc.h
index c33b98cdc43fb4..96b3bc2e6333bc 100644
--- a/Include/internal/pycore_gc.h
+++ b/Include/internal/pycore_gc.h
@@ -8,8 +8,8 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_pystate.h"
-#include "pycore_runtime_structs.h"
+#include "pycore_interp_structs.h" // PyGC_Head
+#include "pycore_pystate.h"       // _PyInterpreterState_GET()
 #include "pycore_typedefs.h"      // _PyInterpreterFrame
 
 
diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h
index 2b68228f8c6470..f99ab59140f0dc 100644
--- a/Include/internal/pycore_import.h
+++ b/Include/internal/pycore_import.h
@@ -9,9 +9,9 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_lock.h"          // PyMutex
-#include "pycore_runtime_structs.h"  // _import_state
 #include "pycore_hashtable.h"     // _Py_hashtable_t
+#include "pycore_interp_structs.h" // _import_state
+#include "pycore_lock.h"          // PyMutex
 
 extern int _PyImport_IsInitialized(PyInterpreterState *);
 
diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h
index eb8ed2ec6ac2c7..49eedd8d2a2332 100644
--- a/Include/internal/pycore_interp.h
+++ b/Include/internal/pycore_interp.h
@@ -8,9 +8,6 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include <stdbool.h>              // bool
-
-#include "pycore_runtime_structs.h"
 #include "pycore_genobject.h"     // _PyGen_FetchStopIterationValue
 
 
diff --git a/Include/internal/pycore_runtime.h 
b/Include/internal/pycore_runtime.h
index bda8a30dd1d0ad..7fc7f343fe600f 100644
--- a/Include/internal/pycore_runtime.h
+++ b/Include/internal/pycore_runtime.h
@@ -8,7 +8,8 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_runtime_structs.h"
+#include "pycore_runtime_structs.h" // _PyRuntimeState
+
 
 /* API */
 
diff --git a/Include/internal/pycore_time.h b/Include/internal/pycore_time.h
index f50c43d8e552b5..23312471c6584e 100644
--- a/Include/internal/pycore_time.h
+++ b/Include/internal/pycore_time.h
@@ -57,7 +57,7 @@ extern "C" {
 #  error "this header requires Py_BUILD_CORE define"
 #endif
 
-#include "pycore_runtime_structs.h"
+#include "pycore_runtime_structs.h" // _PyTimeFraction
 
 #ifdef __clang__
 struct timeval;
diff --git a/Include/internal/pycore_typeobject.h 
b/Include/internal/pycore_typeobject.h
index a5bea7116ba807..cd36400c0d3e95 100644
--- a/Include/internal/pycore_typeobject.h
+++ b/Include/internal/pycore_typeobject.h
@@ -9,8 +9,8 @@ extern "C" {
 #endif
 
 #include "pycore_function.h"
+#include "pycore_interp_structs.h" // managed_static_type_state
 #include "pycore_moduleobject.h"  // PyModuleObject
-#include "pycore_runtime_structs.h" // type state
 #include "pycore_stats.h"
 
 

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to