Skip to content

Commit

Permalink
pypy: final fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Dec 20, 2020
1 parent 839f13e commit db74cc8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
6 changes: 4 additions & 2 deletions src/ffi/pythonrun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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,
Expand Down
6 changes: 0 additions & 6 deletions tests/test_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit db74cc8

Please sign in to comment.