Skip to content

Conversation

@minrk
Copy link
Contributor

@minrk minrk commented Aug 2, 2024

previously, setting py_limited_api=False only appeared to affect the ABI tag of modules, as Py_LIMITED_API was still unconditionally defined in most cases by _cffi_include.h here.

The changlog says:

You can manually disable Py_LIMITED_API by calling ffi.set_source(..., py_limited_api=False).

but this doesn't appear to have been the case. With this change, the behavior matches at least my understanding of the docs on the matter.

The fact that setting py_limited_api=False didn't work is what led me to #104, which is unnecessary with this PR.

previously, setting py_limited_api=False only appeared to affect the ABI tag of modules,
as Py_LIMITED_API was still unconditionally defined in most cases by _cffi_include.h
@arigo
Copy link
Contributor

arigo commented Aug 2, 2024

The setting py_limited_api=False in the comment probably worked at some point for some goal like running Windows with CPython 3.4. I'm not sure I understand all possible consequences of this small patch, though, so maybe play it safer and only define _CFFI_NO_LIMITED_API if py_limited_api is explicitly set to False, and not if it is simply missing?

@minrk
Copy link
Contributor Author

minrk commented Aug 2, 2024

Makes perfect sense; done!

@arigo arigo enabled auto-merge (squash) August 2, 2024 10:49
@arigo
Copy link
Contributor

arigo commented Aug 2, 2024

Looks good, thanks!

@arigo arigo merged commit 16b143d into python-cffi:main Aug 2, 2024
@minrk minrk deleted the respect-py_limited_api branch August 4, 2024 07:07
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