Description
Bug report
(See #110968 (comment).)
When I added Py_mod_multiple_interpreters
1 to Include/moduleobject.h, I forgot to restrict the limited API version in which it should be there.
The fix should be something similar to what we did in gh-110969, combined with gh-111584. We will need to backport the change to 3.12.
Basically, the change would be something like:
- #define Py_mod_multiple_interpreters 3
+ #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000
+ # define Py_mod_multiple_interpreters 3
+ #endif
FYI, gh-110968 already dealt with the same issue for the pre-defined slot values (e.g. Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED
).
Linked PRs
- gh-111698: Restrict Py_mod_multiple_interpreters to 3.12+ under Py_LIMITED_API #111707
- [3.12] gh-111698: Restrict Py_mod_multiple_interpreters to 3.12+ Under Py_LIMITED_API (gh-111707) #111787
Footnotes
-
I added
Py_mod_multiple_interpreters
in gh-104148 (1c420e1), along with some pre-defined values (e.g.Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED
). The direct motivation was to make an implicit contract in PEP 489 (i.e. "must support subinterpreters") explicit. (See gh-104108.) The indirect motivation was PEP 684. ↩