parent
13ba9cffd0
commit
96b2bfd34b
@ -0,0 +1,25 @@
|
|||||||
|
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(-)
|
||||||
|
|
||||||
|
diff --git a/src/impl_/pymodule.rs b/src/impl_/pymodule.rs
|
||||||
|
index b05652b..94555ff 100644
|
||||||
|
--- a/src/impl_/pymodule.rs
|
||||||
|
+++ b/src/impl_/pymodule.rs
|
||||||
|
@@ -107,7 +107,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
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
@ -1,54 +0,0 @@
|
|||||||
From 0654258b18d314c83d6a3e78c4030d22b6b3ea75 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Fabio Valentini <decathorpe@gmail.com>
|
|
||||||
Date: Wed, 26 Jun 2024 18:52:08 +0200
|
|
||||||
Subject: [PATCH] fix regression in 128-bit number conversions
|
|
||||||
|
|
||||||
---
|
|
||||||
src/conversions/std/num.rs | 23 +++++++++++++----------
|
|
||||||
1 file changed, 13 insertions(+), 10 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/conversions/std/num.rs b/src/conversions/std/num.rs
|
|
||||||
index effe7c7..1304e73 100644
|
|
||||||
--- a/src/conversions/std/num.rs
|
|
||||||
+++ b/src/conversions/std/num.rs
|
|
||||||
@@ -238,15 +238,18 @@ mod fast_128bit_int_conversion {
|
|
||||||
unsafe { ffi::PyNumber_Index(ob.as_ptr()).assume_owned_or_err(ob.py())? };
|
|
||||||
let mut buffer = [0u8; std::mem::size_of::<$rust_type>()];
|
|
||||||
#[cfg(not(Py_3_13))]
|
|
||||||
- crate::err::error_on_minusone(ob.py(), unsafe {
|
|
||||||
- ffi::_PyLong_AsByteArray(
|
|
||||||
- num.as_ptr() as *mut ffi::PyLongObject,
|
|
||||||
- buffer.as_mut_ptr(),
|
|
||||||
- buffer.len(),
|
|
||||||
- 1,
|
|
||||||
- $is_signed.into(),
|
|
||||||
- )
|
|
||||||
- })?;
|
|
||||||
+ {
|
|
||||||
+ crate::err::error_on_minusone(ob.py(), unsafe {
|
|
||||||
+ ffi::_PyLong_AsByteArray(
|
|
||||||
+ num.as_ptr() as *mut ffi::PyLongObject,
|
|
||||||
+ buffer.as_mut_ptr(),
|
|
||||||
+ buffer.len(),
|
|
||||||
+ 1,
|
|
||||||
+ $is_signed.into(),
|
|
||||||
+ )
|
|
||||||
+ })?;
|
|
||||||
+ Ok(<$rust_type>::from_le_bytes(buffer))
|
|
||||||
+ }
|
|
||||||
#[cfg(Py_3_13)]
|
|
||||||
{
|
|
||||||
let mut flags = ffi::Py_ASNATIVEBYTES_NATIVE_ENDIAN;
|
|
||||||
@@ -272,8 +275,8 @@ mod fast_128bit_int_conversion {
|
|
||||||
"Python int larger than 128 bits",
|
|
||||||
));
|
|
||||||
}
|
|
||||||
+ Ok(<$rust_type>::from_ne_bytes(buffer))
|
|
||||||
}
|
|
||||||
- Ok(<$rust_type>::from_ne_bytes(buffer))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "experimental-inspect")]
|
|
||||||
--
|
|
||||||
2.45.2
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
SHA512 (pyo3-0.22.0.crate) = 44e0237fd3a8d4c7b082c48a5c8a52d8f4cc4673d134f680e29504bb46d870015fa210da34de4c1998defbcd4afdf2aaea4e148fbe093e4b2c8b0d064cd48da4
|
SHA512 (pyo3-0.22.2.crate) = e8bae09059f50ffe477dad44499cedeaf3a734665f0fd8e8bd4b44f48578d21e4bdb8d55ceea00c5a27da750761842ddf89cfcecdecb2e7a4a17ab192259be9c
|
||||||
|
Loading…
Reference in new issue