From 6f937ac667086baf5b0b87077b417925494351c9 Mon Sep 17 00:00:00 2001 From: Michael Simacek Date: Fri, 7 Aug 2026 12:58:09 +0200 Subject: [PATCH] Prepare for GraalPy 3.13 --- include/pybind11/detail/internals.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h index 7107b70688..295485ffab 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h @@ -101,7 +101,11 @@ class thread_specific_storage { // However, in GraalPy (as of v25.0 or older), TSS is implemented by Java and this call // requires a living Python interpreter. #ifdef GRAALVM_PYTHON +# if PY_VERSION_HEX >= 0x030D0000 + if (Py_IsInitialized() == 0 || Py_IsFinalizing() != 0) { +# else if (Py_IsInitialized() == 0 || _Py_IsFinalizing() != 0) { +# endif return; } #endif