From aa011f4a9db26cb0da68d9d207f424898c29f7de Mon Sep 17 00:00:00 2001 From: mejrs <59372212+mejrs@users.noreply.github.com> Date: Tue, 3 Oct 2023 23:25:45 +0200 Subject: [PATCH] Update PyModuleDef_Slot types --- newsfragments/3494.added.md | 1 + pyo3-ffi/src/moduleobject.rs | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 newsfragments/3494.added.md diff --git a/newsfragments/3494.added.md b/newsfragments/3494.added.md new file mode 100644 index 00000000000..7055e52a48e --- /dev/null +++ b/newsfragments/3494.added.md @@ -0,0 +1 @@ +Added the Py_mod_multiple_interpreters constant and its possible values. \ No newline at end of file diff --git a/pyo3-ffi/src/moduleobject.rs b/pyo3-ffi/src/moduleobject.rs index 72482498a33..f4306b18639 100644 --- a/pyo3-ffi/src/moduleobject.rs +++ b/pyo3-ffi/src/moduleobject.rs @@ -85,6 +85,15 @@ impl Default for PyModuleDef_Slot { pub const Py_mod_create: c_int = 1; pub const Py_mod_exec: c_int = 2; +#[cfg(Py_3_12)] +pub const Py_mod_multiple_interpreters: c_int = 3; + +#[cfg(Py_3_12)] +pub const Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED: *mut c_void = 0 as *mut c_void; +#[cfg(Py_3_12)] +pub const Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED: *mut c_void = 1 as *mut c_void; +#[cfg(Py_3_12)] +pub const Py_MOD_PER_INTERPRETER_GIL_SUPPORTED: *mut c_void = 2 as *mut c_void; // skipped non-limited _Py_mod_LAST_SLOT