diff --git a/src/python_interpreters.rs b/src/python_interpreters.rs index e897f186..c61d2a09 100644 --- a/src/python_interpreters.rs +++ b/src/python_interpreters.rs @@ -419,6 +419,9 @@ impl InterpreterState for v3_13_0::PyInterpreterState { fn head(&self) -> *mut Self::ThreadState { self.threads.head } + fn gil_locked(&self) -> Option { + Some(self._gil.locked != 0) + } fn modules(&self) -> *mut Self::Object { self.imports.modules } diff --git a/src/python_process_info.rs b/src/python_process_info.rs index 1cfbc89c..65befeb1 100644 --- a/src/python_process_info.rs +++ b/src/python_process_info.rs @@ -566,6 +566,15 @@ pub fn get_threadstate_address( config: &Config, ) -> Result { let threadstate_address = match version { + Version { + major: 3, + minor: 13, + .. + } => { + let interp: v3_13_0::_is = Default::default(); + let offset = crate::utils::offset_of(&interp, &interp._gil.last_holder); + interpreter_address + offset + } Version { major: 3, minor: 12, diff --git a/tests/integration_test.py b/tests/integration_test.py index 0e57b3de..e5f56557 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -16,11 +16,6 @@ # (doesn't seem to be working quite right - TODO: investigate) GIL = ["--gil"] if not sys.platform.startswith("win") else [] -# also disable GIL checks on python 3.12+ for now -if sys.version_info.major == 3 or sys.version_info.minor >= 12: - GIL = [] - - PYSPY = which("py-spy")