[Python-checkins] bpo-35081: Add pycore_ prefix to internal header files (GH-10263)

Victor Stinner webhook-mailer at python.org
Wed Oct 31 19:52:32 EDT 2018


https://github.com/python/cpython/commit/27e2d1f21975dfb8c0ddcb192fa0f45a51b7977e
commit: 27e2d1f21975dfb8c0ddcb192fa0f45a51b7977e
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2018-11-01T00:52:28+01:00
summary:

bpo-35081: Add pycore_ prefix to internal header files (GH-10263)

* Rename Include/internal/ header files:

  * pyatomic.h -> pycore_atomic.h
  * ceval.h -> pycore_ceval.h
  * condvar.h -> pycore_condvar.h
  * context.h -> pycore_context.h
  * pygetopt.h -> pycore_getopt.h
  * gil.h -> pycore_gil.h
  * hamt.h -> pycore_hamt.h
  * hash.h -> pycore_hash.h
  * mem.h -> pycore_mem.h
  * pystate.h -> pycore_state.h
  * warnings.h -> pycore_warnings.h

* PCbuild project, Makefile.pre.in, Modules/Setup: add the
  Include/internal/ directory to the search paths of header files.
* Update includes. For example, replace #include "internal/mem.h"
  with #include "pycore_mem.h".

files:
A Include/internal/pycore_atomic.h
A Include/internal/pycore_ceval.h
A Include/internal/pycore_condvar.h
A Include/internal/pycore_context.h
A Include/internal/pycore_getopt.h
A Include/internal/pycore_gil.h
A Include/internal/pycore_hamt.h
A Include/internal/pycore_hash.h
A Include/internal/pycore_mem.h
A Include/internal/pycore_state.h
A Include/internal/pycore_warnings.h
D Include/internal/ceval.h
D Include/internal/condvar.h
D Include/internal/context.h
D Include/internal/gil.h
D Include/internal/hamt.h
D Include/internal/hash.h
D Include/internal/mem.h
D Include/internal/pyatomic.h
D Include/internal/pygetopt.h
D Include/internal/pystate.h
D Include/internal/warnings.h
M Include/pystate.h
M Makefile.pre.in
M Modules/Setup
M Modules/_functoolsmodule.c
M Modules/_io/bufferedio.c
M Modules/_threadmodule.c
M Modules/_xxsubinterpretersmodule.c
M Modules/gcmodule.c
M Modules/getpath.c
M Modules/main.c
M Modules/makesetup
M Modules/posixmodule.c
M Modules/signalmodule.c
M Objects/abstract.c
M Objects/bytearrayobject.c
M Objects/bytesobject.c
M Objects/call.c
M Objects/cellobject.c
M Objects/classobject.c
M Objects/codeobject.c
M Objects/descrobject.c
M Objects/dictobject.c
M Objects/exceptions.c
M Objects/frameobject.c
M Objects/funcobject.c
M Objects/genobject.c
M Objects/iterobject.c
M Objects/listobject.c
M Objects/memoryobject.c
M Objects/methodobject.c
M Objects/moduleobject.c
M Objects/object.c
M Objects/obmalloc.c
M Objects/odictobject.c
M Objects/setobject.c
M Objects/sliceobject.c
M Objects/tupleobject.c
M Objects/typeobject.c
M Objects/unicodeobject.c
M PC/getpathp.c
M PCbuild/pyproject.props
M PCbuild/pythoncore.vcxproj
M PCbuild/pythoncore.vcxproj.filters
M Parser/myreadline.c
M Parser/pgenmain.c
M Python/_warnings.c
M Python/bltinmodule.c
M Python/ceval.c
M Python/ceval_gil.h
M Python/codecs.c
M Python/condvar.h
M Python/context.c
M Python/coreconfig.c
M Python/dynload_shlib.c
M Python/errors.c
M Python/frozenmain.c
M Python/getopt.c
M Python/hamt.c
M Python/import.c
M Python/pathconfig.c
M Python/pylifecycle.c
M Python/pystate.c
M Python/pythonrun.c
M Python/symtable.c
M Python/sysmodule.c
M Python/thread.c
M Python/traceback.c

diff --git a/Include/internal/pyatomic.h b/Include/internal/pycore_atomic.h
similarity index 100%
rename from Include/internal/pyatomic.h
rename to Include/internal/pycore_atomic.h
diff --git a/Include/internal/ceval.h b/Include/internal/pycore_ceval.h
similarity index 96%
rename from Include/internal/ceval.h
rename to Include/internal/pycore_ceval.h
index 4297b5a51ce4..ddeeb5c4256f 100644
--- a/Include/internal/ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -4,7 +4,7 @@
 extern "C" {
 #endif
 
-#include "internal/pyatomic.h"
+#include "pycore_atomic.h"
 #include "pythread.h"
 
 struct _pending_calls {
@@ -25,7 +25,7 @@ struct _pending_calls {
     int last;
 };
 
-#include "internal/gil.h"
+#include "pycore_gil.h"
 
 struct _ceval_runtime_state {
     int recursion_limit;
diff --git a/Include/internal/condvar.h b/Include/internal/pycore_condvar.h
similarity index 100%
rename from Include/internal/condvar.h
rename to Include/internal/pycore_condvar.h
diff --git a/Include/internal/context.h b/Include/internal/pycore_context.h
similarity index 96%
rename from Include/internal/context.h
rename to Include/internal/pycore_context.h
index 59f88f2614e9..57a410c06f68 100644
--- a/Include/internal/context.h
+++ b/Include/internal/pycore_context.h
@@ -2,7 +2,7 @@
 #define Py_INTERNAL_CONTEXT_H
 
 
-#include "internal/hamt.h"
+#include "pycore_hamt.h"
 
 
 struct _pycontextobject {
diff --git a/Include/internal/pygetopt.h b/Include/internal/pycore_getopt.h
similarity index 100%
rename from Include/internal/pygetopt.h
rename to Include/internal/pycore_getopt.h
diff --git a/Include/internal/gil.h b/Include/internal/pycore_gil.h
similarity index 95%
rename from Include/internal/gil.h
rename to Include/internal/pycore_gil.h
index 7743b3f0aa8b..5059850d76f8 100644
--- a/Include/internal/gil.h
+++ b/Include/internal/pycore_gil.h
@@ -4,8 +4,8 @@
 extern "C" {
 #endif
 
-#include "internal/condvar.h"
-#include "internal/pyatomic.h"
+#include "pycore_condvar.h"
+#include "pycore_atomic.h"
 
 #ifndef Py_HAVE_CONDVAR
 #  error You need either a POSIX-compatible or a Windows system!
diff --git a/Include/internal/hamt.h b/Include/internal/pycore_hamt.h
similarity index 100%
rename from Include/internal/hamt.h
rename to Include/internal/pycore_hamt.h
diff --git a/Include/internal/hash.h b/Include/internal/pycore_hash.h
similarity index 100%
rename from Include/internal/hash.h
rename to Include/internal/pycore_hash.h
diff --git a/Include/internal/mem.h b/Include/internal/pycore_mem.h
similarity index 100%
rename from Include/internal/mem.h
rename to Include/internal/pycore_mem.h
diff --git a/Include/internal/pystate.h b/Include/internal/pycore_state.h
similarity index 98%
rename from Include/internal/pystate.h
rename to Include/internal/pycore_state.h
index 38845d32ecaf..ff25d2ebf449 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pycore_state.h
@@ -7,9 +7,9 @@ extern "C" {
 #include "pystate.h"
 #include "pythread.h"
 
-#include "internal/mem.h"
-#include "internal/ceval.h"
-#include "internal/warnings.h"
+#include "pycore_mem.h"
+#include "pycore_ceval.h"
+#include "pycore_warnings.h"
 
 
 /* GIL state */
diff --git a/Include/internal/warnings.h b/Include/internal/pycore_warnings.h
similarity index 100%
rename from Include/internal/warnings.h
rename to Include/internal/pycore_warnings.h
diff --git a/Include/pystate.h b/Include/pystate.h
index 8860f124002c..7fc921e9ac73 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -250,7 +250,7 @@ PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_Get(void);
 #endif
 #ifdef Py_BUILD_CORE
    /* Macro which should only be used for performance critical code.
-      Need "#include "internal/pystate.h". See also _PyInterpreterState_Get()
+      Need "#include "pycore_state.h". See also _PyInterpreterState_Get()
       and _PyGILState_GetInterpreterStateUnsafe(). */
 #  define _PyInterpreterState_GET_UNSAFE() (PyThreadState_GET()->interp)
 #endif
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 232025f1cb61..0336290dd841 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -91,7 +91,7 @@ CONFIGURE_LDFLAGS=	@LDFLAGS@
 # command line to append to these values without stomping the pre-set
 # values.
 PY_CFLAGS=	$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
-PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST)
+PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal
 # Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
 # be able to build extension modules using the directories specified in the
 # environment variables
@@ -1025,14 +1025,14 @@ PYTHON_HEADERS= \
 		pyconfig.h \
 		$(PARSER_HEADERS) \
 		$(srcdir)/Include/Python-ast.h \
-		$(srcdir)/Include/internal/ceval.h \
-		$(srcdir)/Include/internal/gil.h \
-		$(srcdir)/Include/internal/mem.h \
-		$(srcdir)/Include/internal/pyatomic.h \
-		$(srcdir)/Include/internal/pygetopt.h \
-		$(srcdir)/Include/internal/pystate.h \
-		$(srcdir)/Include/internal/context.h \
-		$(srcdir)/Include/internal/warnings.h \
+		$(srcdir)/Include/internal/pycore_atomic.h \
+		$(srcdir)/Include/internal/pycore_ceval.h \
+		$(srcdir)/Include/internal/pycore_context.h \
+		$(srcdir)/Include/internal/pycore_getopt.h \
+		$(srcdir)/Include/internal/pycore_gil.h \
+		$(srcdir)/Include/internal/pycore_mem.h \
+		$(srcdir)/Include/internal/pycore_state.h \
+		$(srcdir)/Include/internal/pycore_warnings.h \
 		$(DTRACE_HEADERS)
 
 $(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)
diff --git a/Modules/Setup b/Modules/Setup
index fb16698d2fc1..c1804630b903 100644
--- a/Modules/Setup
+++ b/Modules/Setup
@@ -101,29 +101,29 @@ PYTHONPATH=$(COREPYTHONPATH)
 # This only contains the minimal set of modules required to run the
 # setup.py script in the root of the Python source tree.
 
-posix -DPy_BUILD_CORE posixmodule.c	# posix (UNIX) system calls
+posix -DPy_BUILD_CORE -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
 errno errnomodule.c			# posix (UNIX) errno values
 pwd pwdmodule.c				# this is needed to find out the user's home dir
 					# if $HOME is not set
 _sre _sre.c				# Fredrik Lundh's new regular expressions
 _codecs _codecsmodule.c			# access to the builtin codecs and codec registry
 _weakref _weakref.c			# weak references
-_functools -DPy_BUILD_CORE _functoolsmodule.c   # Tools for working with functions and callable objects
+_functools -DPy_BUILD_CORE -I$(srcdir)/Include/internal _functoolsmodule.c   # Tools for working with functions and callable objects
 _operator _operator.c	        	# operator.add() and similar goodies
 _collections _collectionsmodule.c	# Container types
 _abc _abc.c				# Abstract base classes
 itertools itertoolsmodule.c		# Functions creating iterators for efficient looping
 atexit atexitmodule.c			# Register functions to be run at interpreter-shutdown
-_signal -DPy_BUILD_CORE signalmodule.c
+_signal -DPy_BUILD_CORE -I$(srcdir)/Include/internal signalmodule.c
 _stat _stat.c				# stat.h interface
-time -DPy_BUILD_CORE timemodule.c	# -lm # time operations and variables
-_thread -DPy_BUILD_CORE _threadmodule.c	# low-level threading interface
+time -DPy_BUILD_CORE -I$(srcdir)/Include/internal timemodule.c	# -lm # time operations and variables
+_thread -DPy_BUILD_CORE -I$(srcdir)/Include/internal _threadmodule.c	# low-level threading interface
 
 # access to ISO C locale support
 _locale _localemodule.c  # -lintl
 
 # Standard I/O baseline
-_io -DPy_BUILD_CORE -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
+_io -DPy_BUILD_CORE -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io _io/_iomodule.c _io/iobase.c _io/fileio.c _io/bytesio.c _io/bufferedio.c _io/textio.c _io/stringio.c
 
 # faulthandler module
 faulthandler faulthandler.c
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c
index ff4172d663b6..6c28b274e561 100644
--- a/Modules/_functoolsmodule.c
+++ b/Modules/_functoolsmodule.c
@@ -1,7 +1,7 @@
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "structmember.h"
 
 /* _functools module written and maintained
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index 2eb5262f0f7b..24ae963b2b89 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -9,7 +9,7 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "structmember.h"
 #include "pythread.h"
 #include "_iomodule.h"
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index d33fa9924308..ad65188d7a42 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -3,7 +3,7 @@
 /* Interface to Sjoerd's portable C thread library */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "structmember.h" /* offsetof */
 #include "pythread.h"
 
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 2eb87871694d..fb0b83add5f7 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -4,7 +4,7 @@
 
 #include "Python.h"
 #include "frameobject.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 
 static char *
diff --git a/Modules/gcmodule.c b/Modules/gcmodule.c
index 4773c79b5328..a54be07b27a8 100644
--- a/Modules/gcmodule.c
+++ b/Modules/gcmodule.c
@@ -24,9 +24,9 @@
 */
 
 #include "Python.h"
-#include "internal/context.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_context.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "frameobject.h"        /* for PyFrame_ClearFreeList */
 #include "pydtrace.h"
 #include "pytime.h"             /* for _PyTime_GetMonotonicClock() */
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 521bc6e35ed3..53e5c2b889a6 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -1,7 +1,7 @@
 /* Return the initial module search path. */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "osdefs.h"
 
 #include <sys/types.h>
diff --git a/Modules/main.c b/Modules/main.c
index 6a8aa05fc370..1918f4f9b8ff 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -2,9 +2,9 @@
 
 #include "Python.h"
 #include "osdefs.h"
-#include "internal/mem.h"
-#include "internal/pygetopt.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_getopt.h"
+#include "pycore_state.h"
 
 #include <locale.h>
 
diff --git a/Modules/makesetup b/Modules/makesetup
index c7b0a60400cf..bf5ca3902b56 100755
--- a/Modules/makesetup
+++ b/Modules/makesetup
@@ -110,7 +110,7 @@ sed -e 's/[ 	]*#.*//' -e '/^[ 	]*$/d' |
 	rulesf="@rules.$$"
 	trap 'rm -f $rulesf' 0 1 2 3
 	echo "
-# Rules appended by makedepend
+# Rules appended by makesetup
 " >$rulesf
 	DEFS=
 	BUILT=
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 9ccdc8eff1bd..0307436e3d59 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -32,7 +32,7 @@
 #else
 #include "winreparse.h"
 #endif
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 /* On android API level 21, 'AT_EACCESS' is not declared although
  * HAVE_FACCESSAT is defined. */
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index a81de6ab6462..1915fd9be456 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -4,7 +4,7 @@
 /* XXX Signals should be recorded per thread, now we have thread state. */
 
 #include "Python.h"
-#include "internal/pyatomic.h"
+#include "pycore_atomic.h"
 
 #ifndef MS_WINDOWS
 #include "posixmodule.h"
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 305910c3584c..be4758d94513 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1,7 +1,7 @@
 /* Abstract Object Interface (many thanks to Jim Fulton) */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include <ctype.h>
 #include "structmember.h" /* we need the offsetof() macro from there */
 #include "longintrepr.h"
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 782e27569780..7a0c340c804e 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -2,8 +2,8 @@
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "structmember.h"
 #include "bytes_methods.h"
 #include "bytesobject.h"
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 1b36661c84de..c912fc04fd4c 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -3,8 +3,8 @@
 #define PY_SSIZE_T_CLEAN
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 
 #include "bytes_methods.h"
 #include "pystrhex.h"
diff --git a/Objects/call.c b/Objects/call.c
index bda05738755a..9061d0b1ac32 100644
--- a/Objects/call.c
+++ b/Objects/call.c
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "frameobject.h"
 
 
diff --git a/Objects/cellobject.c b/Objects/cellobject.c
index 7b05e61ce46f..0b390c78f04e 100644
--- a/Objects/cellobject.c
+++ b/Objects/cellobject.c
@@ -1,8 +1,8 @@
 /* Cell object implementation */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 
 PyObject *
 PyCell_New(PyObject *obj)
diff --git a/Objects/classobject.c b/Objects/classobject.c
index c4efaf282020..93d1c67f1b43 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -1,8 +1,8 @@
 /* Class object implementation (dead now except for methods) */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "structmember.h"
 
 #define TP_DESCR_GET(t) ((t)->tp_descr_get)
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index cedf11ee8af8..6d8e9ac154ed 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -3,7 +3,7 @@
 #include "Python.h"
 #include "code.h"
 #include "structmember.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 /* Holder for co_extra information */
 typedef struct {
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
index 82afa8c63f86..a23b97f396f9 100644
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -1,7 +1,7 @@
 /* Descriptors -- a new, flexible way to describe attributes */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "structmember.h" /* Why is this not included in Python.h? */
 
 /*[clinic input]
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 363d902e9c59..a9ae907d9f24 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -111,7 +111,7 @@ converting the dict to the combined table.
 #define PyDict_MINSIZE 8
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "dict-common.h"
 #include "stringlib/eq.h"    /* to get unicode_eq() */
 
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 6aa3d8f8e19c..da79260ab3b8 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -6,8 +6,8 @@
 
 #define PY_SSIZE_T_CLEAN
 #include <Python.h>
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "structmember.h"
 #include "osdefs.h"
 
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 64ee386ddf96..7704022dd2e4 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -1,7 +1,7 @@
 /* Frame object implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 #include "code.h"
 #include "frameobject.h"
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index c2f79c05dbb2..e5278f09af2b 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -2,8 +2,8 @@
 /* Function object implementation */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "code.h"
 #include "structmember.h"
 
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 453b1003300b..885b3f2eca72 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -1,7 +1,7 @@
 /* Generator object implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "frameobject.h"
 #include "structmember.h"
 #include "opcode.h"
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index 5f5ebfc8c0e5..23f0639db2f1 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -1,8 +1,8 @@
 /* Iterator objects */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 
 typedef struct {
     PyObject_HEAD
diff --git a/Objects/listobject.c b/Objects/listobject.c
index e85fa5c52635..e38b21f2a30b 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -1,7 +1,7 @@
 /* List object implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "accu.h"
 
 #ifdef STDC_HEADERS
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c
index adaa67c06446..f234bb4117dc 100644
--- a/Objects/memoryobject.c
+++ b/Objects/memoryobject.c
@@ -1,8 +1,8 @@
 /* Memoryview object implementation */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "pystrhex.h"
 #include <stddef.h>
 
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 9176e39234f7..b0bbfa2f5f9d 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -2,8 +2,8 @@
 /* Method object implementation */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "structmember.h"
 
 /* Free list for method objects to safe malloc/free overhead
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 5181941ee7bc..7fb711a1cb07 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -2,7 +2,7 @@
 /* Module object implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "structmember.h"
 
 static Py_ssize_t max_module_number;
diff --git a/Objects/object.c b/Objects/object.c
index b72ad019c796..f7395c783ae8 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2,8 +2,8 @@
 /* Generic object operations; and implementation of None */
 
 #include "Python.h"
-#include "internal/pystate.h"
-#include "internal/context.h"
+#include "pycore_state.h"
+#include "pycore_context.h"
 #include "frameobject.h"
 
 #ifdef __cplusplus
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 88ded83a29e4..6a65a1572e86 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "internal/mem.h"
+#include "pycore_mem.h"
 
 #include <stdbool.h>
 
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 67c3674ee095..81c996be5615 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -465,7 +465,7 @@ Potential Optimizations
 */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "structmember.h"
 #include "dict-common.h"
 #include <stddef.h>
diff --git a/Objects/setobject.c b/Objects/setobject.c
index aa1f4eedbfd4..42fe80fc0503 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -32,7 +32,7 @@
 */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "structmember.h"
 
 /* Object used as dummy key to fill deleted entries */
diff --git a/Objects/sliceobject.c b/Objects/sliceobject.c
index 2288df514954..9f1cf78cedd3 100644
--- a/Objects/sliceobject.c
+++ b/Objects/sliceobject.c
@@ -14,8 +14,8 @@ this type and there is exactly one in existence.
 */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "structmember.h"
 
 static PyObject *
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 288f1348117a..cce266f7a2d2 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -2,7 +2,7 @@
 /* Tuple object implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "accu.h"
 
 /*[clinic input]
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 722fe5f94735..9a390b3e5078 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -1,7 +1,7 @@
 /* Type object implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "frameobject.h"
 #include "structmember.h"
 
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index f3f940ac9ef5..3692da64122f 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -40,7 +40,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 #define PY_SSIZE_T_CLEAN
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "ucnhash.h"
 #include "bytes_methods.h"
 #include "stringlib/eq.h"
diff --git a/PC/getpathp.c b/PC/getpathp.c
index ada02899966a..3a62738d2337 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -80,7 +80,7 @@
 
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "osdefs.h"
 #include <wchar.h>
 
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index 95b349c077e5..cf85e1b25d58 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -27,7 +27,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>$(PySourcePath)Include;$(PySourcePath)Include\internal;$(PySourcePath)PC;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;$(_PlatformPreprocessorDefinition)$(_DebugPreprocessorDefinition)$(_PydPreprocessorDefinition)%(PreprocessorDefinitions)</PreprocessorDefinitions>
       
       <Optimization>MaxSpeed</Optimization>
@@ -194,4 +194,4 @@ public override bool Execute() {
     <Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
     <Exec Command='$(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError="false" />
   </Target>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index f65bb5b2197c..ebc35a7c0049 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -112,15 +112,16 @@
     <ClInclude Include="..\Include\graminit.h" />
     <ClInclude Include="..\Include\grammar.h" />
     <ClInclude Include="..\Include\import.h" />
-    <ClInclude Include="..\Include\internal\ceval.h" />
-    <ClInclude Include="..\Include\internal\condvar.h" />
-    <ClInclude Include="..\Include\internal\context.h" />
-    <ClInclude Include="..\Include\internal\gil.h" />
-    <ClInclude Include="..\Include\internal\hamt.h" />
-    <ClInclude Include="..\Include\internal\mem.h" />
-    <ClInclude Include="..\Include\internal\pyatomic.h" />
-    <ClInclude Include="..\Include\internal\pystate.h" />
-    <ClInclude Include="..\Include\internal\warnings.h" />
+    <ClInclude Include="..\Include\internal\pycore_atomic.h" />
+    <ClInclude Include="..\Include\internal\pycore_ceval.h" />
+    <ClInclude Include="..\Include\internal\pycore_condvar.h" />
+    <ClInclude Include="..\Include\internal\pycore_context.h" />
+    <ClInclude Include="..\Include\internal\pycore_getopt.h" />
+    <ClInclude Include="..\Include\internal\pycore_gil.h" />
+    <ClInclude Include="..\Include\internal\pycore_hamt.h" />
+    <ClInclude Include="..\Include\internal\pycore_mem.h" />
+    <ClInclude Include="..\Include\internal\pycore_state.h" />
+    <ClInclude Include="..\Include\internal\pycore_warnings.h" />
     <ClInclude Include="..\Include\intrcheck.h" />
     <ClInclude Include="..\Include\iterobject.h" />
     <ClInclude Include="..\Include\listobject.h" />
diff --git a/PCbuild/pythoncore.vcxproj.filters b/PCbuild/pythoncore.vcxproj.filters
index 7fdadc81676d..052c89cf806c 100644
--- a/PCbuild/pythoncore.vcxproj.filters
+++ b/PCbuild/pythoncore.vcxproj.filters
@@ -135,31 +135,34 @@
     <ClInclude Include="..\Include\import.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\ceval.h">
+    <ClInclude Include="..\Include\internal\pycore_atomic.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\condvar.h">
+    <ClInclude Include="..\Include\internal\pycore_ceval.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\context.h">
+    <ClInclude Include="..\Include\internal\pycore_condvar.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\gil.h">
+    <ClInclude Include="..\Include\internal\pycore_context.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\hamt.h">
+    <ClInclude Include="..\Include\internal\pycore_getopt.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\mem.h">
+    <ClInclude Include="..\Include\internal\pycore_gil.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\pyatomic.h">
+    <ClInclude Include="..\Include\internal\pycore_hamt.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\pystate.h">
+    <ClInclude Include="..\Include\internal\pycore_mem.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\warnings.h">
+    <ClInclude Include="..\Include\internal\pycore_state.h">
+      <Filter>Include</Filter>
+    </ClInclude>
+    <ClInclude Include="..\Include\internal\pycore_warnings.h">
       <Filter>Include</Filter>
     </ClInclude>
     <ClInclude Include="..\Include\intrcheck.h">
@@ -249,9 +252,6 @@
     <ClInclude Include="..\Include\pyfpe.h">
       <Filter>Include</Filter>
     </ClInclude>
-    <ClInclude Include="..\Include\internal\pygetopt.h">
-      <Filter>Include</Filter>
-    </ClInclude>
     <ClInclude Include="..\Include\pylifecycle.h">
       <Filter>Include</Filter>
     </ClInclude>
diff --git a/Parser/myreadline.c b/Parser/myreadline.c
index edb291a6691a..d18cf1b61bac 100644
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -10,7 +10,7 @@
 */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #ifdef MS_WINDOWS
 #define WIN32_LEAN_AND_MEAN
 #include "windows.h"
diff --git a/Parser/pgenmain.c b/Parser/pgenmain.c
index 0a4b0c5da029..9e2159b34759 100644
--- a/Parser/pgenmain.c
+++ b/Parser/pgenmain.c
@@ -16,8 +16,8 @@
 #define PGEN
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "pgenheaders.h"
 #include "grammar.h"
 #include "node.h"
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 8e1c01d0b295..619ec6f26b49 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "frameobject.h"
 #include "clinic/_warnings.c.h"
 
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 8001c603939a..6c8672adfc15 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2,7 +2,7 @@
 
 #include "Python.h"
 #include "Python-ast.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 #include "node.h"
 #include "code.h"
diff --git a/Python/ceval.c b/Python/ceval.c
index 644312384843..5599b6efa3e3 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -10,7 +10,7 @@
 #define PY_LOCAL_AGGRESSIVE
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 #include "code.h"
 #include "dictobject.h"
diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h
index 4a054a97f710..f2d5fdba0153 100644
--- a/Python/ceval_gil.h
+++ b/Python/ceval_gil.h
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
-#include "internal/pyatomic.h"
+#include "pycore_atomic.h"
 
 /* First some general settings */
 
diff --git a/Python/codecs.c b/Python/codecs.c
index 4062429fe354..62bbee61c0a3 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -9,7 +9,7 @@ Copyright (c) Corporation for National Research Initiatives.
    ------------------------------------------------------------------------ */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "ucnhash.h"
 #include <ctype.h>
 
diff --git a/Python/condvar.h b/Python/condvar.h
index 951b8ad47f07..13517409aeab 100644
--- a/Python/condvar.h
+++ b/Python/condvar.h
@@ -41,7 +41,7 @@
 #define _CONDVAR_IMPL_H_
 
 #include "Python.h"
-#include "internal/condvar.h"
+#include "pycore_condvar.h"
 
 #ifdef _POSIX_THREADS
 /*
diff --git a/Python/context.c b/Python/context.c
index 7344e968ccee..b1f67b5aa75b 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -1,9 +1,9 @@
 #include "Python.h"
 
 #include "structmember.h"
-#include "internal/pystate.h"
-#include "internal/context.h"
-#include "internal/hamt.h"
+#include "pycore_state.h"
+#include "pycore_context.h"
+#include "pycore_hamt.h"
 
 
 #define CONTEXT_FREELIST_MAXLEN 255
diff --git a/Python/coreconfig.c b/Python/coreconfig.c
index 81086f42d679..ad14a8a457da 100644
--- a/Python/coreconfig.c
+++ b/Python/coreconfig.c
@@ -1,6 +1,6 @@
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include <locale.h>
 #ifdef HAVE_LANGINFO_H
 #  include <langinfo.h>
diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
index 73ae26d13146..98965607761a 100644
--- a/Python/dynload_shlib.c
+++ b/Python/dynload_shlib.c
@@ -2,7 +2,7 @@
 /* Support for dynamic loading of extension modules */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "importdl.h"
 
 #include <sys/types.h>
diff --git a/Python/errors.c b/Python/errors.c
index 2926ea1918e6..14a70d9ce8e2 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -2,7 +2,7 @@
 /* Error handling */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 #ifndef __STDC__
 #ifndef MS_WINDOWS
diff --git a/Python/frozenmain.c b/Python/frozenmain.c
index 86af2b6f94c5..9e9066665867 100644
--- a/Python/frozenmain.c
+++ b/Python/frozenmain.c
@@ -2,7 +2,7 @@
 /* Python interpreter main program for frozen scripts */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include <locale.h>
 
 #ifdef MS_WINDOWS
diff --git a/Python/getopt.c b/Python/getopt.c
index e8d7e523c2ea..c165a94a2d84 100644
--- a/Python/getopt.c
+++ b/Python/getopt.c
@@ -31,7 +31,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <wchar.h>
-#include "internal/pygetopt.h"
+#include "pycore_getopt.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/Python/hamt.c b/Python/hamt.c
index 562f777ea0bf..be3813b9aab1 100644
--- a/Python/hamt.c
+++ b/Python/hamt.c
@@ -1,8 +1,8 @@
 #include "Python.h"
 
 #include "structmember.h"
-#include "internal/pystate.h"
-#include "internal/hamt.h"
+#include "pycore_state.h"
+#include "pycore_hamt.h"
 
 /*
 This file provides an implemention of an immutable mapping using the
diff --git a/Python/import.c b/Python/import.c
index 338cd302dcc0..18cd29df7e93 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -4,9 +4,9 @@
 
 #include "Python-ast.h"
 #undef Yield /* undefine macro conflicting with winbase.h */
-#include "internal/hash.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_hash.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "errcode.h"
 #include "marshal.h"
 #include "code.h"
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index efccb8d6bb85..04064159f86b 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -2,8 +2,8 @@
 
 #include "Python.h"
 #include "osdefs.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include <wchar.h>
 
 #ifdef __cplusplus
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index fab96fd52381..d349aaf6deca 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -4,10 +4,10 @@
 
 #include "Python-ast.h"
 #undef Yield /* undefine macro conflicting with winbase.h */
-#include "internal/context.h"
-#include "internal/hamt.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_context.h"
+#include "pycore_hamt.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "grammar.h"
 #include "node.h"
 #include "token.h"
diff --git a/Python/pystate.c b/Python/pystate.c
index 98e954d9d91d..c77902a7f9c7 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -2,8 +2,8 @@
 /* Thread and interpreter state structures and their interfaces */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 
 #define _PyThreadState_SET(value) \
     _Py_atomic_store_relaxed(&_PyRuntime.gilstate.tstate_current, \
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 276c5d102858..2f61aab40d90 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -12,7 +12,7 @@
 
 #include "Python-ast.h"
 #undef Yield /* undefine macro conflicting with winbase.h */
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #include "grammar.h"
 #include "node.h"
 #include "token.h"
diff --git a/Python/symtable.c b/Python/symtable.c
index dc934a556daa..dae6fda0e4c7 100644
--- a/Python/symtable.c
+++ b/Python/symtable.c
@@ -1,5 +1,5 @@
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 #ifdef Yield
 #undef Yield /* undefine conflicting macro from winbase.h */
 #endif
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 71414c959789..cb13e21c9405 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -15,8 +15,8 @@ Data members:
 */
 
 #include "Python.h"
-#include "internal/mem.h"
-#include "internal/pystate.h"
+#include "pycore_mem.h"
+#include "pycore_state.h"
 #include "code.h"
 #include "frameobject.h"
 #include "pythread.h"
diff --git a/Python/thread.c b/Python/thread.c
index a1e1fa64f120..63553816b350 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 "internal/pystate.h"
+#include "pycore_state.h"
 
 #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 5b5c715a0f44..e2070f08a5a2 100644
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -2,7 +2,7 @@
 /* Traceback implementation */
 
 #include "Python.h"
-#include "internal/pystate.h"
+#include "pycore_state.h"
 
 #include "code.h"
 #include "frameobject.h"



More information about the Python-checkins mailing list