Skip to content

Commit

Permalink
pypy: support 7.3.8
Browse files Browse the repository at this point in the history
Co-authored-by: messense <[email protected]>
  • Loading branch information
davidhewitt and messense committed Mar 31, 2022
1 parent fb89600 commit c18e60f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/callback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@ where
let unwind_safe_py = AssertUnwindSafe(pool.python());
let panic_result = panic::catch_unwind(move || -> PyResult<_> {
let py = *unwind_safe_py;
#[cfg(all(PyPy, not(Py_3_8)))]
{
const PYPY_GOOD_VERSION: [u8; 3] = [7, 3, 8];
let version = py
.import("sys")?
.getattr("implementation")?
.getattr("version")?;
if version.lt(crate::types::PyTuple::new(py, &PYPY_GOOD_VERSION))? {
let warn = py.import("warnings")?.getattr("warn")?;
warn.call1((
"PyPy 3.7 versions older than 7.3.8 are known to have binary \
compatibility issues which may cause segfaults. Please upgrade.",
))?;
}
}
body(py)
});

Expand Down

0 comments on commit c18e60f

Please sign in to comment.