Fix test_cext and test_cppext.
static PyObject *
test_datetime(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
{
+ // datetime.h is excluded from the limited C API
+#ifndef Py_LIMITED_API
PyDateTime_IMPORT;
if (PyErr_Occurred()) {
return NULL;
}
+#endif
Py_RETURN_NONE;
}
static PyObject *
test_datetime(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args))
{
+ // datetime.h is excluded from the limited C API
+#ifndef Py_LIMITED_API
PyDateTime_IMPORT;
if (PyErr_Occurred()) {
return NULL;
}
+#endif
Py_RETURN_NONE;
}