Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove workaround for python/cpython#81061. #517

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Sep 25, 2024

Rubicon contains a ctypes_patch to work around python/cpython#49960, a limitation in returning structures or unions from a C function.

That workaround itself contains a workaround for python/cpython#81061. However, that issue was resolved by python/cpython#13364, which is available in Python 3.10+.

This PR modifies the use of the inner workaround so that it is only employed on older versions of Python. There are existing test cases to validate that the handling for the python/cpython#81061 case works.

The patch is structured so that when pyupgrade runs in ~October 2025 to remove Python 3.9 support, the removal of the conditional branches will leave working code.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Collaborator

@dgelessus dgelessus left a comment

Choose a reason for hiding this comment

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

Looks good to me, aside from the changelog entry. Thank you!

(I didn't bother removing this earlier, because the remainder of ctypes_patch is still necessary. But it does make sense to remove this inner workaround once rubicon-objc drops support for the affected Python versions.)

changes/517.bugfix.rst Outdated Show resolved Hide resolved
Co-authored-by: dgelessus <dgelessus@users.noreply.github.com>
@freakboy3742 freakboy3742 merged commit a128b1e into main Sep 26, 2024
20 checks passed
@freakboy3742 freakboy3742 deleted the none-setfunc-restype branch September 26, 2024 21:26
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