summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-11-25 12:35:22 (GMT)
committerGitHub <noreply@github.com>2021-11-25 12:35:22 (GMT)
commitce5a6460aebdc51a810d2755782fe8f0d7918ec2 (patch)
tree519ba975034568d4acde458964675f73d416ff31
parent632d589afcaac3b8441c8c042a98e1ae452533e0 (diff)
downloadcpython-ce5a6460aebdc51a810d2755782fe8f0d7918ec2.zip
cpython-ce5a6460aebdc51a810d2755782fe8f0d7918ec2.tar.gz
cpython-ce5a6460aebdc51a810d2755782fe8f0d7918ec2.tar.bz2
bpo-39026: Fix Python.h when building with Xcode (GH-29488) (GH-29732)
Fix Python.h to build C extensions with Xcode: remove a relative include from Include/cpython/pystate.h. (cherry picked from commit 4ae26b9c1d0c33e3db92c6f305293f9240dea358)
-rw-r--r--Include/Python.h3
-rw-r--r--Include/cpython/pystate.h2
-rw-r--r--Misc/NEWS.d/next/C API/2021-11-09-15-42-11.bpo-39026.sUnYWn.rst2
3 files changed, 3 insertions, 4 deletions
diff --git a/Include/Python.h b/Include/Python.h
index a83befa..d3186c3 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -106,6 +106,7 @@
#include "sliceobject.h"
#include "cellobject.h"
#include "iterobject.h"
+#include "cpython/initconfig.h"
#include "genobject.h"
#include "descrobject.h"
#include "genericaliasobject.h"
@@ -118,8 +119,6 @@
#include "codecs.h"
#include "pyerrors.h"
-
-#include "cpython/initconfig.h"
#include "pythread.h"
#include "pystate.h"
#include "context.h"
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index b0d30bd..7c995b9 100644
--- a/Include/cpython/pystate.h
+++ b/Include/cpython/pystate.h
@@ -2,8 +2,6 @@
# error "this header file must not be included directly"
#endif
-#include "cpython/initconfig.h"
-
PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
diff --git a/Misc/NEWS.d/next/C API/2021-11-09-15-42-11.bpo-39026.sUnYWn.rst b/Misc/NEWS.d/next/C API/2021-11-09-15-42-11.bpo-39026.sUnYWn.rst
new file mode 100644
index 0000000..77a0119
--- /dev/null
+++ b/Misc/NEWS.d/next/C API/2021-11-09-15-42-11.bpo-39026.sUnYWn.rst
@@ -0,0 +1,2 @@
+Fix Python.h to build C extensions with Xcode: remove a relative include
+from ``Include/cpython/pystate.h``.