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

python: enum: fix build for Python 3.11 #231

Closed
wants to merge 1 commit into from

Conversation

sgn
Copy link
Contributor

@sgn sgn commented Sep 21, 2022

Python 3.9 introduced Py_SET_SIZE function to set size instead of relying on Py_SIZE() as a macro 3.9.

Python 3.10 started to encourage to use Py_SET_SIZE instead of assigning into return value of Py_SIZE 3.10.

Python 3.11 flips the switch, turn Py_SIZE into a function 3.11, thus Py_SIZE(obj) will be a rvalue. We need to use Py_SET_SIZE to set size now.

@sgn sgn force-pushed the fix-python-3.11 branch 2 times, most recently from e28a379 to f63c07c Compare September 21, 2022 03:52
python/enum.c Outdated Show resolved Hide resolved
python/enum.c Outdated Show resolved Hide resolved
Python 3.9 introduced Py_SET_SIZE function to set size instead of
relying on Py_SIZE() as a macro [3.9].

Python 3.10 started to encourage to use Py_SET_SIZE instead of
assigning into return value of Py_SIZE [3.10].

Python 3.11 flips the switch, turn Py_SIZE into a function [3.11],
thus Py_SIZE(obj) will be a rvalue. We need to use Py_SET_SIZE
to set size now.

[3.9]: https://docs.python.org/3.9/c-api/structures.html#c.Py_SET_SIZE
[3.10]: https://docs.python.org/3.10/c-api/structures.html#c.Py_SIZE
[3.11]: https://docs.python.org/3.11/c-api/structures.html#c.Py_SIZE

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
@jameshilliard
Copy link
Contributor

@mchehab Could we get this merged and a new release made as python 3.11 was just released?

@hosiet
Copy link
Contributor

hosiet commented Oct 26, 2022

Would be glad to see a hotfix / tag / release targeting python3.11 since the upcoming Debian 12 is on pursuit to ship python3.11.

@sc0rp10n-py
Copy link

Hey @sgn
I need to compile the python zbar urgently
#234
Can you possibly help me with this issue.

I know this is not the right place to ask, but you have made this PR, so I am assuming you were able to successfully compile it as well.

archlinux-github pushed a commit to archlinux/svntogit-packages that referenced this pull request Apr 6, 2023
Add backport of upstreamed patch, as upstream seems to be defunct: mchehab/zbar#231

git-svn-id: file:///srv/repos/svn-packages/svn@472846 eb2447ed-0c53-47e4-bac8-5bc4a241df78
archlinux-github pushed a commit to archlinux/svntogit-packages that referenced this pull request Apr 6, 2023
Add backport of upstreamed patch, as upstream seems to be defunct: mchehab/zbar#231

git-svn-id: file:///srv/repos/svn-packages/svn@472846 eb2447ed-0c53-47e4-bac8-5bc4a241df78
@mchehab
Copy link
Owner

mchehab commented Apr 16, 2023

Patch merged, thanks!

@mchehab mchehab closed this Apr 16, 2023
@sgn sgn deleted the fix-python-3.11 branch April 24, 2023 08:45
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.

None yet

5 participants