File Make-unsafe-subinterpreter-support-available-via-cfg.patch of Package python-cryptography

From d59176bc05aa37838fd4a8dd253f47c962f61118 Mon Sep 17 00:00:00 2001
From: Fabio Valentini <decathorpe@gmail.com>
Date: Tue, 23 Jul 2024 14:41:04 +0200
Subject: [PATCH] Make unsafe subinterpreter support available via cfg flag

---
 src/impl_/pymodule.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/vendor/pyo3-0.25.1/src/impl_/pymodule.rs
+++ b/vendor/pyo3-0.25.1/src/impl_/pymodule.rs
@@ -100,7 +100,7 @@ impl ModuleDef {
         // that static data is not reused across interpreters.
         //
         // PyPy does not have subinterpreters, so no need to check interpreter ID.
-        #[cfg(not(any(PyPy, GraalPy)))]
+        #[cfg(not(any(PyPy, GraalPy, pyo3_unsafe_allow_subinterpreters)))]
         {
             // PyInterpreterState_Get is only available on 3.9 and later, but is missing
             // from python3.dll for Windows stable API on 3.9
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,3 +29,6 @@ openssl-sys = "0.9.108"
 
 [profile.release]
 overflow-checks = true
+
+[patch.crates-io]
+pyo3 = { path="vendor/pyo3-0.25.1" }
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -269,8 +269,6 @@ dependencies = [
 [[package]]
 name = "pyo3"
 version = "0.25.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a"
 dependencies = [
  "indoc",
  "libc",
openSUSE Build Service is sponsored by