-
Notifications
You must be signed in to change notification settings - Fork 105
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
Use Py_SET_REFCNT(self, refcnt);
instead of Py_REFCNT(self) = refcnt;
.
#271
Comments
Thanks from me too.
See #270. This could be fixed with a new release.
See also this comment on the Conda Forge feedstock: conda-forge/pyuv-feedstock#12 (comment) Unfortunately the original author no longer has the time to work on this project. Would you be able to propose this change in a PR? |
Happy to give the commit bit to someone who has the time to drive it forward. |
Might be a good idea to add the "maintainer wanted" topic to the repo - https://github.com/topics/maintainer-wanted |
@polkovnikov: Can you turn your proposed fix into a PR please? (If not, let me know and I can probably make some copy-pasta PR and give you credit in the commit message.) Why I'm here: my tmux uses powerline which uses pyuv -- I either have to remove powerline or fix pyuv. |
@bjornfor Current (unfixed) code should work for Python < 3.9, but new code with Near
so you can replace line with:
You may even implement a helper |
@polkovnikov: Thanks! (I actually came up with something similar on my own.) Now the only remaining question is which branch should I make the PR against, @saghul ? It seems |
master please. |
Specifically this build error: In file included from src/pyuv.c:8: src/handle.c: In function ‘resurrect_object’: src/handle.c:17:21: error: lvalue required as left operand of assignment 17 | Py_REFCNT(self) = refcnt; | ^ Fixes saghul#271. Co-authored-by: @polkovnikov
PR ready: #275 |
Specifically this build error: In file included from src/pyuv.c:8: src/handle.c: In function ‘resurrect_object’: src/handle.c:17:21: error: lvalue required as left operand of assignment 17 | Py_REFCNT(self) = refcnt; | ^ Fixes saghul#271. Co-authored-by: @polkovnikov
Specifically this build error: In file included from src/pyuv.c:8: src/handle.c: In function ‘resurrect_object’: src/handle.c:17:21: error: lvalue required as left operand of assignment 17 | Py_REFCNT(self) = refcnt; | ^ Fixes #271. Co-authored-by: @polkovnikov
This can be closed now. (I thought my "Fixes ..." comment in the commit message would auto-close, but it didn't.) |
Use backwards-compatible `Py_SET_REFCNT`, reference: saghul/pyuv#271
Starting from Python 3.10 your library doesn't compile, it has just single compile issue, in file
handle.c
you doPy_REFCNT(self) = refcnt;
, but you should instead doPy_SET_REFCNT(self, refcnt);
.Starting from Python 3.10 it is not valid to set refcnt directly by assignment operator. Because now
Py_REFCNT()
is a function that returns l-value which is not assignable.Py_SET_REFCNT()
for setting refcount was present in all Python versions, so it is safe to use this setter function instead of direct assignment for all Python versions.More than that in Python 3.10 it was the only compilation issue (at least on Windows), after fixing it wheel was built successfully from current repository trunk.
Also would be nice if you release prebuilt binary wheels on PyPi for all Python versions, currently it looks like that there are no prebuilt wheels for Python versions
>= 3.7
.BTW, Thanks for great Python package!
The text was updated successfully, but these errors were encountered: