Skip to content

Commit

Permalink
pypy check
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Jan 14, 2024
1 parent f6240ea commit b81ae9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub fn safe_repr(v: &PyAny) -> Cow<str> {

/// Extract an i64 from a python object more quickly, see
/// https://github.com/PyO3/pyo3/pull/3742#discussion_r1451763928
#[cfg(not(any(target_pointer_width = "32", target_os = "windows")))]
#[cfg(not(any(target_pointer_width = "32", windows, PyPy)))]
pub fn extract_i64(obj: &PyAny) -> Option<i64> {
let val = unsafe { ffi::PyLong_AsLong(obj.as_ptr()) };
if val == -1 && PyErr::occurred(obj.py()) {
Expand All @@ -112,7 +112,7 @@ pub fn extract_i64(obj: &PyAny) -> Option<i64> {
}
}

#[cfg(any(target_pointer_width = "32", target_os = "windows"))]
#[cfg(any(target_pointer_width = "32", windows, PyPy))]
pub fn extract_i64(v: &PyAny) -> Option<i64> {
if v.is_instance_of::<pyo3::types::PyInt>() {
v.extract().ok()
Expand Down

0 comments on commit b81ae9f

Please sign in to comment.