Skip to content

Commit

Permalink
Fix 128-bit int regression on big-endian with Python <3.13
Browse files Browse the repository at this point in the history
Fixes PyO3#4290.
  • Loading branch information
musicinmybrain committed Jun 26, 2024
1 parent 7c2f5e8 commit 6aefc4a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/conversions/std/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ 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(not(Py_3_13))]
Ok(<$rust_type>::from_le_bytes(buffer))
}

#[cfg(feature = "experimental-inspect")]
Expand Down

0 comments on commit 6aefc4a

Please sign in to comment.