Skip to content

Commit faeb2c2

Browse files
committed
Skip test_config() on Python 3.8
It needs _Py_GetConfig() which was added to Python 3.9.
1 parent 4ed4587 commit faeb2c2

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎pythoncapi_compat.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2213,9 +2213,11 @@ static inline int Py_fclose(FILE *file)
22132213
#endif
22142214

22152215

2216-
#if (0x03080000 <= PY_VERSION_HEX \
2216+
#if (0x03090000 <= PY_VERSION_HEX \
22172217
&& PY_VERSION_HEX < 0x030E0000 \
22182218
&& !defined(PYPY_VERSION) && !defined(Py_LIMITED_API))
2219+
2220+
// Use the internal C API added to Python 3.9
22192221
PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
22202222

22212223
static inline PyObject*

‎tests/test_pythoncapi_compat_cext.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,7 @@ test_file(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
22242224
}
22252225

22262226

2227-
#if (0x03080000 <= PY_VERSION_HEX \
2227+
#if (0x03090000 <= PY_VERSION_HEX \
22282228
&& !defined(PYPY_VERSION) && !defined(Py_LIMITED_API))
22292229
static PyObject *
22302230
test_config(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
@@ -2695,7 +2695,7 @@ static struct PyMethodDef methods[] = {
26952695
{"test_long_stdint", test_long_stdint, METH_NOARGS, _Py_NULL},
26962696
{"test_structmember", test_structmember, METH_NOARGS, _Py_NULL},
26972697
{"test_file", test_file, METH_NOARGS, _Py_NULL},
2698-
#if (0x03080000 <= PY_VERSION_HEX \
2698+
#if (0x03090000 <= PY_VERSION_HEX \
26992699
&& !defined(PYPY_VERSION) && !defined(Py_LIMITED_API))
27002700
{"test_config", test_config, METH_NOARGS, _Py_NULL},
27012701
#endif

0 commit comments

Comments
 (0)