Skip to content

[C API] Py_mod_multiple_interpreters Added to Limited C API Without Versioning #111698

Closed
@ericsnowcurrently

Description

@ericsnowcurrently

Bug report

(See #110968 (comment).)

When I added Py_mod_multiple_interpreters1 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).

CC @encukou, @vstinner

Linked PRs

Footnotes

  1. 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.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions