Skip to content

Commit 2639997

Browse files
committed
Allow Py_LIMITED_API for (Py_GIL_DISABLED && _Py_OPAQUE_PYOBJECT)
1 parent 85bc89f commit 2639997

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Include/Python.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@
4545
# endif
4646
#endif
4747

48-
// gh-111506: The free-threaded build is not compatible with the limited API
49-
// or the stable ABI.
50-
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
51-
# error "The limited API is not currently supported in the free-threaded build"
52-
#endif
48+
#if defined(Py_GIL_DISABLED)
49+
# if defined(Py_LIMITED_API) && !defined(_Py_OPAQUE_PYOBJECT)
50+
# error "Py_LIMITED_API is not currently supported in the free-threaded build"
51+
# endif
5352

54-
#if defined(Py_GIL_DISABLED) && defined(_MSC_VER)
55-
# include <intrin.h> // __readgsqword()
56-
#endif
53+
# if defined(_MSC_VER)
54+
# include <intrin.h> // __readgsqword()
55+
# endif
5756

58-
#if defined(Py_GIL_DISABLED) && defined(__MINGW32__)
59-
# include <intrin.h> // __readgsqword()
60-
#endif
57+
# if defined(__MINGW32__)
58+
# include <intrin.h> // __readgsqword()
59+
# endif
60+
#endif // Py_GIL_DISABLED
6161

6262
// Include Python header files
6363
#include "pyport.h"

0 commit comments

Comments
 (0)