pypy: final fix

This commit is contained in:
David Hewitt 2020-12-20 12:32:46 +00:00
parent 839f13ea21
commit db74cc85fa
3 changed files with 5 additions and 9 deletions

View File

@ -103,7 +103,7 @@ jobs:
run: cargo test --no-default-features --features "abi3,macros" --target ${{ matrix.platform.rust-target }}
# Run tests again, for abi3-py36 (the minimal Python version)
- if: (matrix.python-version != 'pypy3') && (matrix.python-version != '3.6')
- if: (matrix.python-version != 'pypy-3.6') && (matrix.python-version != '3.6')
name: Test (abi3-py36)
run: cargo test --no-default-features --features "abi3-py36,macros" --target ${{ matrix.platform.rust-target }}

View File

@ -14,6 +14,9 @@ pub struct PyCompilerFlags {
pub cf_flags: c_int,
}
#[cfg(Py_LIMITED_API)]
opaque_struct!(PyCompilerFlags);
#[cfg(not(Py_LIMITED_API))]
opaque_struct!(_mod);
@ -145,8 +148,7 @@ extern "C" {
#[cfg(Py_LIMITED_API)]
#[cfg(not(PyPy))]
pub fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject;
#[cfg(PyPy)]
#[cfg(not(Py_LIMITED_API))]
#[cfg(any(PyPy, not(Py_LIMITED_API)))]
#[cfg_attr(PyPy, link_name = "PyPy_CompileStringFlags")]
pub fn Py_CompileStringFlags(
string: *const c_char,

View File

@ -271,12 +271,6 @@ impl PyGCProtocol for TraversableClass {
}
}
#[cfg(PyPy)]
unsafe fn get_type_traverse(tp: *mut pyo3::ffi::PyTypeObject) -> Option<pyo3::ffi::traverseproc> {
(*tp).tp_traverse
}
#[cfg(not(PyPy))]
unsafe fn get_type_traverse(tp: *mut pyo3::ffi::PyTypeObject) -> Option<pyo3::ffi::traverseproc> {
std::mem::transmute(pyo3::ffi::PyType_GetSlot(tp, pyo3::ffi::Py_tp_traverse))
}