diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 08403857bc6..fc89d23d1b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }} diff --git a/src/ffi/pythonrun.rs b/src/ffi/pythonrun.rs index 27bcd9d34f5..1308c891eec 100644 --- a/src/ffi/pythonrun.rs +++ b/src/ffi/pythonrun.rs @@ -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, diff --git a/tests/test_gc.rs b/tests/test_gc.rs index 559ce39c35c..c7e4015a70d 100644 --- a/tests/test_gc.rs +++ b/tests/test_gc.rs @@ -271,12 +271,6 @@ impl PyGCProtocol for TraversableClass { } } -#[cfg(PyPy)] -unsafe fn get_type_traverse(tp: *mut pyo3::ffi::PyTypeObject) -> Option { - (*tp).tp_traverse -} - -#[cfg(not(PyPy))] unsafe fn get_type_traverse(tp: *mut pyo3::ffi::PyTypeObject) -> Option { std::mem::transmute(pyo3::ffi::PyType_GetSlot(tp, pyo3::ffi::Py_tp_traverse)) }