Skip to content

Commit

Permalink
Enable BigInt conversion for PyPy (#2626)
Browse files Browse the repository at this point in the history
* Enable bigint conversion for PyPy

* Update src/conversions/num_bigint.rs

* Add a changelog entry for PyPy `num-bigint` support

Co-authored-by: messense <messense@icloud.com>
  • Loading branch information
Mario Rugiero and messense committed Sep 20, 2022
1 parent 371c821 commit d72989f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions newsfragments/2626.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for `num-bigint` feature on `PyPy`.
3 changes: 1 addition & 2 deletions src/conversions/num_bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// based on Daniel Grunwald's https://github.com/dgrunwald/rust-cpython

#![cfg(all(feature = "num-bigint", not(any(Py_LIMITED_API, PyPy))))]
#![cfg(all(feature = "num-bigint", not(any(Py_LIMITED_API))))]
//! Conversions to and from [num-bigint](https://docs.rs/num-bigint)’s [`BigInt`] and [`BigUint`] types.
//!
//! This is useful for converting Python integers when they may not fit in Rust's built-in integer types.
Expand Down Expand Up @@ -64,7 +64,6 @@ use crate::{
use num_bigint::{BigInt, BigUint};
use std::os::raw::{c_int, c_uchar};

#[cfg(not(all(windows, PyPy)))]
unsafe fn extract(ob: &PyLong, buffer: &mut [c_uchar], is_signed: c_int) -> PyResult<()> {
err::error_on_minusone(
ob.py(),
Expand Down

0 comments on commit d72989f

Please sign in to comment.