Mailing List Archive

bpo-39026: Fix Python.h when building with Xcode (GH-29488)
https://github.com/python/cpython/commit/4ae26b9c1d0c33e3db92c6f305293f9240dea358
commit: 4ae26b9c1d0c33e3db92c6f305293f9240dea358
branch: main
author: Victor Stinner <vstinner@python.org>
committer: vstinner <vstinner@python.org>
date: 2021-11-23T18:58:57+01:00
summary:

bpo-39026: Fix Python.h when building with Xcode (GH-29488)

Fix Python.h to build C extensions with Xcode: remove a relative
include from Include/cpython/pystate.h.

files:
A Misc/NEWS.d/next/C API/2021-11-09-15-42-11.bpo-39026.sUnYWn.rst
M Include/Python.h
M Include/cpython/pystate.h

diff --git a/Include/Python.h b/Include/Python.h
index 6e3303ac9a3b0..7260ae5cd0b4f 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -72,6 +72,7 @@
#include "sliceobject.h"
#include "cpython/cellobject.h"
#include "iterobject.h"
+#include "cpython/initconfig.h"
#include "pystate.h"
#include "cpython/genobject.h"
#include "descrobject.h"
@@ -83,7 +84,6 @@
#include "cpython/pytime.h"
#include "codecs.h"
#include "pyerrors.h"
-#include "cpython/initconfig.h"
#include "pythread.h"
#include "cpython/context.h"
#include "modsupport.h"
diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h
index 9ac0a298baab4..5adbf3b495316 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 0000000000000..77a0119792152
--- /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``.

_______________________________________________
Python-checkins mailing list
Python-checkins@python.org
https://mail.python.org/mailman/listinfo/python-checkins