Mercurial > hgrepos > Python > libs > ConfigMix
changeset 547:1cbe8b0f2b78
Put the value of Py_LIMITED_API into the module dict when the C-extension is compiled against the stable API
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 01 Jan 2022 21:18:55 +0100 |
| parents | adf65c31f8fc |
| children | 325008573bc6 |
| files | configmix/_speedups.c |
| diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
