Skip to content

Commit 621cebe

Browse files
authored
bpo-35081: Rename internal headers (GH-10275)
Rename Include/internal/ headers: * pycore_hash.h -> pycore_pyhash.h * pycore_lifecycle.h -> pycore_pylifecycle.h * pycore_mem.h -> pycore_pymem.h * pycore_state.h -> pycore_pystate.h Add missing headers to Makefile.pre.in and PCbuild: * pycore_condvar.h. * pycore_hamt.h * pycore_pyhash.h
1 parent 19c46a4 commit 621cebe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+102
-95
lines changed
File renamed without changes.
File renamed without changes.

Include/internal/pycore_state.h renamed to Include/internal/pycore_pystate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ extern "C" {
1212
#include "pythread.h"
1313

1414
#include "pycore_ceval.h"
15-
#include "pycore_mem.h"
1615
#include "pycore_pathconfig.h"
16+
#include "pycore_pymem.h"
1717
#include "pycore_warnings.h"
1818

1919

Include/pystate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);
301301
/* Get the current Python thread state.
302302
303303
Macro using PyThreadState_Get() or _PyThreadState_GET() depending if
304-
pycore_state.h is included or not (this header redefines the macro).
304+
pycore_pystate.h is included or not (this header redefines the macro).
305305
306306
If PyThreadState_Get() is used, issue a fatal error if the current thread
307307
state is NULL.

Makefile.pre.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1027,13 +1027,16 @@ PYTHON_HEADERS= \
10271027
$(srcdir)/Include/internal/pycore_accu.h \
10281028
$(srcdir)/Include/internal/pycore_atomic.h \
10291029
$(srcdir)/Include/internal/pycore_ceval.h \
1030+
$(srcdir)/Include/internal/pycore_condvar.h \
10301031
$(srcdir)/Include/internal/pycore_context.h \
10311032
$(srcdir)/Include/internal/pycore_getopt.h \
10321033
$(srcdir)/Include/internal/pycore_gil.h \
1033-
$(srcdir)/Include/internal/pycore_lifecycle.h \
1034-
$(srcdir)/Include/internal/pycore_mem.h \
1034+
$(srcdir)/Include/internal/pycore_hamt.h \
10351035
$(srcdir)/Include/internal/pycore_pathconfig.h \
1036-
$(srcdir)/Include/internal/pycore_state.h \
1036+
$(srcdir)/Include/internal/pycore_pyhash.h \
1037+
$(srcdir)/Include/internal/pycore_pylifecycle.h \
1038+
$(srcdir)/Include/internal/pycore_pymem.h \
1039+
$(srcdir)/Include/internal/pycore_pystate.h \
10371040
$(srcdir)/Include/internal/pycore_warnings.h \
10381041
$(DTRACE_HEADERS)
10391042

Modules/_functoolsmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
#include "Python.h"
3-
#include "pycore_mem.h"
4-
#include "pycore_state.h"
3+
#include "pycore_pymem.h"
4+
#include "pycore_pystate.h"
55
#include "structmember.h"
66

77
/* _functools module written and maintained

Modules/_io/bufferedio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#define PY_SSIZE_T_CLEAN
1111
#include "Python.h"
12-
#include "pycore_state.h"
12+
#include "pycore_pystate.h"
1313
#include "structmember.h"
1414
#include "pythread.h"
1515
#include "_iomodule.h"

Modules/_threadmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* Interface to Sjoerd's portable C thread library */
44

55
#include "Python.h"
6-
#include "pycore_state.h"
6+
#include "pycore_pystate.h"
77
#include "structmember.h" /* offsetof */
88
#include "pythread.h"
99

Modules/_xxsubinterpretersmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "Python.h"
66
#include "frameobject.h"
7-
#include "pycore_state.h"
7+
#include "pycore_pystate.h"
88

99

1010
static char *

Modules/gcmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
#include "Python.h"
2727
#include "pycore_context.h"
28-
#include "pycore_mem.h"
29-
#include "pycore_state.h"
28+
#include "pycore_pymem.h"
29+
#include "pycore_pystate.h"
3030
#include "frameobject.h" /* for PyFrame_ClearFreeList */
3131
#include "pydtrace.h"
3232
#include "pytime.h" /* for _PyTime_GetMonotonicClock() */

Modules/getpath.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "osdefs.h"
55
#include "pycore_fileutils.h"
66
#include "pycore_pathconfig.h"
7-
#include "pycore_state.h"
7+
#include "pycore_pystate.h"
88

99
#include <sys/types.h>
1010
#include <string.h>

Modules/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#include "Python.h"
44
#include "osdefs.h"
55
#include "pycore_getopt.h"
6-
#include "pycore_lifecycle.h"
7-
#include "pycore_mem.h"
86
#include "pycore_pathconfig.h"
9-
#include "pycore_state.h"
7+
#include "pycore_pylifecycle.h"
8+
#include "pycore_pymem.h"
9+
#include "pycore_pystate.h"
1010

1111
#include <locale.h>
1212

Modules/posixmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#else
3333
#include "winreparse.h"
3434
#endif
35-
#include "pycore_state.h"
35+
#include "pycore_pystate.h"
3636

3737
/* On android API level 21, 'AT_EACCESS' is not declared although
3838
* HAVE_FACCESSAT is defined. */

Objects/abstract.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Abstract Object Interface (many thanks to Jim Fulton) */
22

33
#include "Python.h"
4-
#include "pycore_state.h"
4+
#include "pycore_pystate.h"
55
#include <ctype.h>
66
#include "structmember.h" /* we need the offsetof() macro from there */
77
#include "longintrepr.h"

Objects/bytearrayobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#define PY_SSIZE_T_CLEAN
44
#include "Python.h"
5-
#include "pycore_mem.h"
6-
#include "pycore_state.h"
5+
#include "pycore_pymem.h"
6+
#include "pycore_pystate.h"
77
#include "structmember.h"
88
#include "bytes_methods.h"
99
#include "bytesobject.h"

Objects/bytesobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#define PY_SSIZE_T_CLEAN
44

55
#include "Python.h"
6-
#include "pycore_mem.h"
7-
#include "pycore_state.h"
6+
#include "pycore_pymem.h"
7+
#include "pycore_pystate.h"
88

99
#include "bytes_methods.h"
1010
#include "pystrhex.h"

Objects/call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "Python.h"
2-
#include "pycore_state.h"
2+
#include "pycore_pystate.h"
33
#include "frameobject.h"
44

55

Objects/cellobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Cell object implementation */
22

33
#include "Python.h"
4-
#include "pycore_mem.h"
5-
#include "pycore_state.h"
4+
#include "pycore_pymem.h"
5+
#include "pycore_pystate.h"
66

77
PyObject *
88
PyCell_New(PyObject *obj)

Objects/classobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Class object implementation (dead now except for methods) */
22

33
#include "Python.h"
4-
#include "pycore_mem.h"
5-
#include "pycore_state.h"
4+
#include "pycore_pymem.h"
5+
#include "pycore_pystate.h"
66
#include "structmember.h"
77

88
#define TP_DESCR_GET(t) ((t)->tp_descr_get)

Objects/codeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "Python.h"
44
#include "code.h"
55
#include "structmember.h"
6-
#include "pycore_state.h"
6+
#include "pycore_pystate.h"
77

88
/* Holder for co_extra information */
99
typedef struct {

Objects/descrobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Descriptors -- a new, flexible way to describe attributes */
22

33
#include "Python.h"
4-
#include "pycore_state.h"
4+
#include "pycore_pystate.h"
55
#include "structmember.h" /* Why is this not included in Python.h? */
66

77
/*[clinic input]

Objects/dictobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ converting the dict to the combined table.
111111
#define PyDict_MINSIZE 8
112112

113113
#include "Python.h"
114-
#include "pycore_state.h"
114+
#include "pycore_pystate.h"
115115
#include "dict-common.h"
116116
#include "stringlib/eq.h" /* to get unicode_eq() */
117117

Objects/exceptions.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
#define PY_SSIZE_T_CLEAN
88
#include <Python.h>
9-
#include "pycore_mem.h"
10-
#include "pycore_state.h"
9+
#include "pycore_pymem.h"
10+
#include "pycore_pystate.h"
1111
#include "structmember.h"
1212
#include "osdefs.h"
1313

Objects/frameobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Frame object implementation */
22

33
#include "Python.h"
4-
#include "pycore_state.h"
4+
#include "pycore_pystate.h"
55

66
#include "code.h"
77
#include "frameobject.h"

Objects/funcobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/* Function object implementation */
33

44
#include "Python.h"
5-
#include "pycore_mem.h"
6-
#include "pycore_state.h"
5+
#include "pycore_pymem.h"
6+
#include "pycore_pystate.h"
77
#include "code.h"
88
#include "structmember.h"
99

Objects/genobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Generator object implementation */
22

33
#include "Python.h"
4-
#include "pycore_state.h"
4+
#include "pycore_pystate.h"
55
#include "frameobject.h"
66
#include "structmember.h"
77
#include "opcode.h"

Objects/iterobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Iterator objects */
22

33
#include "Python.h"
4-
#include "pycore_mem.h"
5-
#include "pycore_state.h"
4+
#include "pycore_pymem.h"
5+
#include "pycore_pystate.h"
66

77
typedef struct {
88
PyObject_HEAD

Objects/listobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* List object implementation */
22

33
#include "Python.h"
4-
#include "pycore_state.h"
4+
#include "pycore_pystate.h"
55
#include "pycore_accu.h"
66

77
#ifdef STDC_HEADERS

Objects/memoryobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Memoryview object implementation */
22

33
#include "Python.h"
4-
#include "pycore_mem.h"
5-
#include "pycore_state.h"
4+
#include "pycore_pymem.h"
5+
#include "pycore_pystate.h"
66
#include "pystrhex.h"
77
#include <stddef.h>
88

Objects/methodobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
/* Method object implementation */
33

44
#include "Python.h"
5-
#include "pycore_mem.h"
6-
#include "pycore_state.h"
5+
#include "pycore_pymem.h"
6+
#include "pycore_pystate.h"
77
#include "structmember.h"
88

99
/* Free list for method objects to safe malloc/free overhead

Objects/moduleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Module object implementation */
33

44
#include "Python.h"
5-
#include "pycore_state.h"
5+
#include "pycore_pystate.h"
66
#include "structmember.h"
77

88
static Py_ssize_t max_module_number;

Objects/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Generic object operations; and implementation of None */
33

44
#include "Python.h"
5-
#include "pycore_state.h"
5+
#include "pycore_pystate.h"
66
#include "pycore_context.h"
77
#include "frameobject.h"
88

Objects/obmalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "Python.h"
2-
#include "pycore_mem.h"
2+
#include "pycore_pymem.h"
33

44
#include <stdbool.h>
55

Objects/odictobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ Potential Optimizations
465465
*/
466466

467467
#include "Python.h"
468-
#include "pycore_state.h"
468+
#include "pycore_pystate.h"
469469
#include "structmember.h"
470470
#include "dict-common.h"
471471
#include <stddef.h>

Objects/setobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
*/
3333

3434
#include "Python.h"
35-
#include "pycore_state.h"
35+
#include "pycore_pystate.h"
3636
#include "structmember.h"
3737

3838
/* Object used as dummy key to fill deleted entries */

Objects/sliceobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ this type and there is exactly one in existence.
1414
*/
1515

1616
#include "Python.h"
17-
#include "pycore_mem.h"
18-
#include "pycore_state.h"
17+
#include "pycore_pymem.h"
18+
#include "pycore_pystate.h"
1919
#include "structmember.h"
2020

2121
static PyObject *

Objects/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* Tuple object implementation */
33

44
#include "Python.h"
5-
#include "pycore_state.h"
5+
#include "pycore_pystate.h"
66
#include "pycore_accu.h"
77

88
/*[clinic input]

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Type object implementation */
22

33
#include "Python.h"
4-
#include "pycore_state.h"
4+
#include "pycore_pystate.h"
55
#include "frameobject.h"
66
#include "structmember.h"
77

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4141
#define PY_SSIZE_T_CLEAN
4242
#include "Python.h"
4343
#include "pycore_fileutils.h"
44-
#include "pycore_state.h"
44+
#include "pycore_pystate.h"
4545
#include "ucnhash.h"
4646
#include "bytes_methods.h"
4747
#include "stringlib/eq.h"

PC/getpathp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080

8181

8282
#include "Python.h"
83-
#include "pycore_state.h"
83+
#include "pycore_pystate.h"
8484
#include "osdefs.h"
8585
#include <wchar.h>
8686

PCbuild/pythoncore.vcxproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,11 @@
119119
<ClInclude Include="..\Include\internal\pycore_getopt.h" />
120120
<ClInclude Include="..\Include\internal\pycore_gil.h" />
121121
<ClInclude Include="..\Include\internal\pycore_hamt.h" />
122-
<ClInclude Include="..\Include\internal\pycore_lifecycle.h" />
123-
<ClInclude Include="..\Include\internal\pycore_mem.h" />
124122
<ClInclude Include="..\Include\internal\pycore_pathconfig.h" />
125-
<ClInclude Include="..\Include\internal\pycore_state.h" />
123+
<ClInclude Include="..\Include\internal\pycore_pyhash.h" />
124+
<ClInclude Include="..\Include\internal\pycore_pylifecycle.h" />
125+
<ClInclude Include="..\Include\internal\pycore_pymem.h" />
126+
<ClInclude Include="..\Include\internal\pycore_pystate.h" />
126127
<ClInclude Include="..\Include\internal\pycore_warnings.h" />
127128
<ClInclude Include="..\Include\intrcheck.h" />
128129
<ClInclude Include="..\Include\iterobject.h" />

0 commit comments

Comments
 (0)