1
1
// Always enable assertions
2
2
#undef NDEBUG
3
3
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
-
15
4
#include "pythoncapi_compat.h"
16
5
17
6
#ifdef Py_LIMITED_API
@@ -417,7 +406,7 @@ test_module(PyObject *Py_UNUSED(module), PyObject* Py_UNUSED(ignored))
417
406
}
418
407
419
408
420
- #ifndef PYPY_VERSION
409
+ #if ( PY_VERSION_HEX <= 0x030B00A1 || 0x030B00A7 <= PY_VERSION_HEX ) && !defined( PYPY_VERSION )
421
410
static PyObject *
422
411
test_float_pack (PyObject * Py_UNUSED (module ), PyObject * Py_UNUSED (ignored ))
423
412
{
@@ -470,7 +459,7 @@ test_float_pack(PyObject *Py_UNUSED(module), PyObject* Py_UNUSED(ignored))
470
459
471
460
Py_RETURN_NONE ;
472
461
}
473
- #endif // !PYPY_VERSION
462
+ #endif
474
463
475
464
476
465
static struct PyMethodDef methods [] = {
@@ -485,7 +474,7 @@ static struct PyMethodDef methods[] = {
485
474
{"test_calls" , test_calls , METH_NOARGS , NULL },
486
475
{"test_gc" , test_gc , METH_NOARGS , NULL },
487
476
{"test_module" , test_module , METH_NOARGS , NULL },
488
- #ifndef PYPY_VERSION
477
+ #if ( PY_VERSION_HEX <= 0x030B00A1 || 0x030B00A7 <= PY_VERSION_HEX ) && ! defined ( PYPY_VERSION )
489
478
{"test_float_pack" , test_float_pack , METH_NOARGS , NULL },
490
479
#endif
491
480
{NULL , NULL , 0 , NULL }
0 commit comments