Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7d3657

Browse files
committed
Fix tests on Python 3.11a5
1 parent 0dfa681 commit c7d3657

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_pythoncapi_compat_cext.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
// Always enable assertions
22
#undef NDEBUG
33

4+
// In Python 3.11a2-3.11a6, _PyFloat_Pack8() is part of the internal C API:
5+
// pythoncapi_compat.h doesn't support these early alpha versions. Workaround
6+
// the issue to be able to test pythoncapi_compat.h on these unsupported Python
7+
// versions anyway.
8+
#include "Python.h"
9+
#if (0x030B00A2 <= PY_VERSION_HEX && PY_VERSION_HEX <= 0x030B00A6) && !defined(PYPY_VERSION)
10+
# define Py_BUILD_CORE 1
11+
# include "internal/pycore_floatobject.h"
12+
# undef Py_BUILD_CORE
13+
#endif
14+
415
#include "pythoncapi_compat.h"
516

617
#ifdef Py_LIMITED_API

0 commit comments

Comments
 (0)