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

Fix memoryview type checking issue #5988

Merged
merged 4 commits into from Feb 11, 2024
Merged

Conversation

XeniaLu
Copy link
Contributor

@XeniaLu XeniaLu commented Feb 10, 2024

Fix the compilation error:

error: call to undeclared function 'PyMemoryView_CheckExact'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  if (!(likely(PyMemoryView_CheckExact(__pyx_v_rv))||((__pyx_v_rv) == Py_None) || __Pyx_RaiseUnexpectedTypeError("memoryview", __pyx_v_rv))) __PYX_ERR(0, 172, __pyx_L1_error)

@da-woods
Copy link
Contributor

Thanks. Do you have some code that causes this issue? It would be good to add a small test to check it doesn't recur.

Copy link
Contributor

@da-woods da-woods 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 thanks.

One suggestion to simplify the test

tests/run/builtin_memory_view.pyx Outdated Show resolved Hide resolved
tests/run/builtin_memory_view.pyx Outdated Show resolved Hide resolved
@XeniaLu
Copy link
Contributor Author

XeniaLu commented Feb 10, 2024

Thanks.

@da-woods
Copy link
Contributor

I'll wait for the CI to pass then merge this

@XeniaLu
Copy link
Contributor Author

XeniaLu commented Feb 10, 2024

Sorry, I have to modify the test again. Actually the issue arises from converting an unknown type of Python object to a memoryview

@da-woods da-woods merged commit 80004cb into cython:master Feb 11, 2024
63 checks passed
da-woods pushed a commit that referenced this pull request Feb 11, 2024
@da-woods
Copy link
Contributor

Thanks for this.

3.0.x commit is 29cf53e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants