-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
gh-89653: PEP 670: Fix PyUnicode_READ() cast #92872
Conversation
See bug report: #92800 |
I'll have to wait until later to test and confirm that it's fixed the Cython bug. Is it worth copying the test-case from #92818? (The actual fix here is probably more sensible though) |
Oh right, I added tests. |
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST() instead.
I rebased the PR and I added more tests about the PyUnicode_READ() cast. |
Lib/test/_testcppext.cpp
Outdated
{ | ||
PyObject *str = PyUnicode_FromString("abc"); | ||
if (str == NULL) { | ||
return NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return NULL; | |
return nullptr; |
I can confirm it fixes the cython bug. |
However on this branch greenlets is still broken:
|
If you consider that it's a regression, please open a separated issue. It seems to be a different warning/error. |
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11. |
GH-92884 is a backport of this pull request to the 3.11 branch. |
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST() instead. (cherry picked from commit e6fd799) Co-authored-by: Victor Stinner <[email protected]>
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST() instead. (cherry picked from commit e6fd799) Co-authored-by: Victor Stinner <[email protected]>
_Py_CAST() cannot be used with a constant type: use _Py_STATIC_CAST()
instead.