Skip to content

Commit aed30e2

Browse files
committed
gh-131238: Add explicit include to pycore headers
1 parent c497f83 commit aed30e2

File tree

18 files changed

+28
-6
lines changed

18 files changed

+28
-6
lines changed

Include/internal/pycore_call.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ extern "C" {
88
# error "this header requires Py_BUILD_CORE define"
99
#endif
1010

11+
#include "pycore_code.h" // EVAL_CALL_STAT_INC_IF_FUNCTION()
1112
#include "pycore_pystate.h" // _PyThreadState_GET()
1213

14+
1315
/* Suggested size (number of positional arguments) for arrays of PyObject*
1416
allocated on a C stack to avoid allocating memory on the heap memory. Such
1517
array is used to pass positional arguments to call functions of the

Include/internal/pycore_tstate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extern "C" {
1010

1111
#include "pycore_brc.h" // struct _brc_thread_state
1212
#include "pycore_freelist_state.h" // struct _Py_freelists
13+
#include "pycore_gc.h" // struct _gc_thread_state
1314
#include "pycore_mimalloc.h" // struct _mimalloc_thread_state
1415
#include "pycore_qsbr.h" // struct qsbr
1516

Modules/_posixsubprocess.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
#include "Python.h"
77
#include "pycore_fileutils.h"
8+
#include "pycore_interp.h" // _PyInterpreterState_GetFinalizing()
89
#include "pycore_pystate.h"
910
#include "pycore_signal.h" // _Py_RestoreSignals()
11+
1012
#if defined(HAVE_PIPE2) && !defined(_GNU_SOURCE)
1113
# define _GNU_SOURCE
1214
#endif

Modules/faulthandler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "pycore_initconfig.h" // _PyStatus_ERR
44
#include "pycore_pyerrors.h" // _Py_DumpExtensionModules
55
#include "pycore_pystate.h" // _PyThreadState_GET()
6+
#include "pycore_runtime.h" // _PyRuntime
67
#include "pycore_signal.h" // Py_NSIG
78
#include "pycore_sysmodule.h" // _PySys_GetRequiredAttr()
89
#include "pycore_time.h" // _PyTime_FromSecondsObject()

Parser/asdl_c.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2274,10 +2274,11 @@ def generate_module_def(mod, metadata, f, internal_h):
22742274
#include "pycore_ast.h"
22752275
#include "pycore_ast_state.h" // struct ast_state
22762276
#include "pycore_ceval.h" // _Py_EnterRecursiveCall
2277-
#include "pycore_lock.h" // _PyOnceFlag
22782277
#include "pycore_interp.h" // _PyInterpreterState.ast
2278+
#include "pycore_lock.h" // _PyOnceFlag
22792279
#include "pycore_modsupport.h" // _PyArg_NoPositional()
22802280
#include "pycore_pystate.h" // _PyInterpreterState_GET()
2281+
#include "pycore_runtime.h" // _Py_ID()
22812282
#include "pycore_setobject.h" // _PySet_NextEntry(), _PySet_Update()
22822283
#include "pycore_unionobject.h" // _Py_union_type_or
22832284
#include "structmember.h"

Parser/pegen.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#include <Python.h>
22
#include "pycore_ast.h" // _PyAST_Validate(),
3-
#include "pycore_pystate.h" // _PyThreadState_GET()
43
#include "pycore_pyerrors.h" // PyExc_IncompleteInputError
4+
#include "pycore_pystate.h" // _PyThreadState_GET()
5+
#include "pycore_runtime.h" // _PyRuntime
56
#include <errcode.h>
67

78
#include "lexer/lexer.h"

Parser/tokenizer/file_tokenizer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#include "Python.h"
22
#include "pycore_call.h"
3-
#include "pycore_import.h"
43
#include "pycore_fileutils.h"
4+
#include "pycore_import.h"
5+
#include "pycore_runtime.h" // _Py_ID()
56
#include "errcode.h"
67

78
#ifdef HAVE_UNISTD_H

Python/Python-ast.c

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/ast.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "Python.h"
66
#include "pycore_ast.h" // asdl_stmt_seq
77
#include "pycore_pystate.h" // _PyThreadState_GET()
8+
#include "pycore_unicodeobject.h" // _PyUnicode_EqualToASCIIString()
89

910
#include <assert.h>
1011
#include <stdbool.h>

Python/codecs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Copyright (c) Corporation for National Research Initiatives.
1414
#include "pycore_lock.h" // PyMutex
1515
#include "pycore_pyerrors.h" // _PyErr_FormatNote()
1616
#include "pycore_pystate.h" // _PyInterpreterState_GET()
17+
#include "pycore_runtime.h" // _Py_ID()
1718
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
1819

1920
static const char *codecs_builtin_error_handlers[] = {

0 commit comments

Comments
 (0)