Skip to content

Commit e5014be

Browse files
authored
bpo-40268: Remove a few pycore_pystate.h includes (pythonGH-19510)
1 parent e194530 commit e5014be

56 files changed

Lines changed: 78 additions & 86 deletions

Some content is hidden

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

Modules/_functoolsmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "Python.h"
22
#include "pycore_pymem.h"
3-
#include "pycore_pystate.h"
3+
#include "pycore_pystate.h" // _PyThreadState_GET()
44
#include "pycore_tupleobject.h"
55
#include "structmember.h"
66

Modules/_io/bufferedio.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define PY_SSIZE_T_CLEAN
1111
#include "Python.h"
1212
#include "pycore_object.h"
13-
#include "pycore_pystate.h"
1413
#include "structmember.h"
1514
#include "pythread.h"
1615
#include "_iomodule.h"

Modules/_io/textio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88

99
#define PY_SSIZE_T_CLEAN
1010
#include "Python.h"
11+
#include "pycore_interp.h" // PyInterpreterState.fs_codec
1112
#include "pycore_object.h"
12-
#include "pycore_pystate.h"
13+
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1314
#include "structmember.h"
1415
#include "_iomodule.h"
1516

Modules/_threadmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "Python.h"
66
#include "pycore_pylifecycle.h"
77
#include "pycore_interp.h" // _PyInterpreterState.num_threads
8-
#include "pycore_pystate.h"
8+
#include "pycore_pystate.h" // _PyThreadState_Init()
99
#include "pythread.h"
1010
#include <stddef.h> // offsetof()
1111

Modules/gcmodule.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626
#include "Python.h"
2727
#include "pycore_context.h"
2828
#include "pycore_initconfig.h"
29+
#include "pycore_interp.h" // PyInterpreterState.gc
2930
#include "pycore_object.h"
3031
#include "pycore_pyerrors.h"
32+
#include "pycore_pystate.h" // _PyThreadState_GET()
3133
#include "pycore_pymem.h"
32-
#include "pycore_pystate.h"
33-
#include "frameobject.h" /* for PyFrame_ClearFreeList */
34+
#include "frameobject.h" // PyFrame_ClearFreeList
3435
#include "pydtrace.h"
35-
#include "pytime.h" /* for _PyTime_GetMonotonicClock() */
36+
#include "pytime.h" // _PyTime_GetMonotonicClock()
3637

3738
typedef struct _gc_runtime_state GCState;
3839

Modules/getpath.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/* Return the initial module search path. */
22

33
#include "Python.h"
4-
#include "pycore_initconfig.h"
5-
#include "osdefs.h"
64
#include "pycore_fileutils.h"
5+
#include "pycore_initconfig.h"
76
#include "pycore_pathconfig.h"
8-
#include "pycore_pystate.h"
7+
#include "osdefs.h"
98

109
#include <sys/types.h>
1110
#include <string.h>

Modules/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "pycore_pathconfig.h"
77
#include "pycore_pylifecycle.h"
88
#include "pycore_pymem.h"
9-
#include "pycore_pystate.h"
9+
#include "pycore_pystate.h" // _PyInterpreterState_GET()
1010

1111
/* Includes for exit_sigint() */
1212
#include <stdio.h> /* perror() */

Modules/posixmodule.c

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

3838
#include "pycore_ceval.h" /* _PyEval_ReInitThreads() */
3939
#include "pycore_import.h" /* _PyImport_ReInitLock() */
40-
#include "pycore_pystate.h" /* _PyRuntime */
40+
#include "pycore_pystate.h" /* _PyInterpreterState_GET() */
4141
#include "pythread.h"
4242
#include "structmember.h"
4343
#ifndef MS_WINDOWS

Modules/signalmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pycore_call.h"
99
#include "pycore_ceval.h"
1010
#include "pycore_pyerrors.h"
11-
#include "pycore_pystate.h"
11+
#include "pycore_pystate.h" // _PyThreadState_GET()
1212

1313
#ifndef MS_WINDOWS
1414
#include "posixmodule.h"

Objects/abstract.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "pycore_abstract.h" // _PyIndex_Check()
55
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
66
#include "pycore_pyerrors.h"
7-
#include "pycore_pystate.h"
7+
#include "pycore_pystate.h" // _PyThreadState_GET()
88
#include <ctype.h>
99
#include "structmember.h" /* we need the offsetof() macro from there */
1010
#include "longintrepr.h"

0 commit comments

Comments
 (0)