# HG changeset patch # User Franz Glasner # Date 1641068335 -3600 # Node ID 1cbe8b0f2b782947717e63322e6d0fcd828e27d1 # Parent adf65c31f8fc789122d160e67389b9c0995585a1 Put the value of Py_LIMITED_API into the module dict when the C-extension is compiled against the stable API diff -r adf65c31f8fc -r 1cbe8b0f2b78 configmix/_speedups.c --- a/configmix/_speedups.c Sat Jan 01 21:03:05 2022 +0100 +++ b/configmix/_speedups.c Sat Jan 01 21:18:55 2022 +0100 @@ -481,6 +481,9 @@ {NULL, NULL, 0, NULL} }; +#define STRINGIFY(s) #s +#define XSTRINGIFY(s) STRINGIFY(s) + static int @@ -496,6 +499,9 @@ PyModule_AddStringConstant(module, "__release__", release); PyModule_AddStringConstant(module, "__date__", date); PyModule_AddStringConstant(module, "__author__", "Franz Glasner"); +#if defined(Py_LIMITED_API) + PyModule_AddStringConstant(module, "Py_LIMITED_API", XSTRINGIFY(Py_LIMITED_API)); +#endif sstate->DOT = PyUnicode_FromStringAndSize(".", 1); if (sstate->DOT == NULL) {