Skip to content

fix FFI cases where PyPy replaced function with macro - #6422

Merged
davidhewitt merged 2 commits into
PyO3:mainfrom
davidhewitt:pypy-new-macros
Sep 16, 2026
Merged

davidhewitt merged 2 commits into
PyO3:mainfrom
davidhewitt:pypy-new-macros

Conversation

@davidhewitt

Copy link
Copy Markdown
Member

This fixes cases PyPy replaced functions with macros in its c-api; due to ordering of checks in pyo3-ffi-check we weren't detecting them.

Similar to #6421 I used local AI to diagnose and produce this patch under my review; it follows the existing mechanical patterns in the codebase.

Comment thread pyo3-ffi/src/setobject.rs
pub fn PySet_CheckExact(op: *mut PyObject) -> c_int;

#[cfg(any(PyPy, RustPython))]
#[cfg(any(all(PyPy, not(Py_3_12)), RustPython))]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Their goal is to be abi3 compatible right? Will this be compatible?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, yes, this is moving towards consistency with the CPython declaration on PyPy 3.12 (i.e. there is no such symbol, just a macro)

@davidhewitt
davidhewitt added this pull request to the merge queue Sep 16, 2026
Merged via the queue into PyO3:main with commit a60b060 Sep 16, 2026
53 checks passed
@davidhewitt
davidhewitt deleted the pypy-new-macros branch September 16, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants