Skip to content

Mark functions as noexcept to support Cython 3#3956

Merged
illume merged 1 commit into
pygame:mainfrom
matusvalo:noexcept
Jul 16, 2023
Merged

Mark functions as noexcept to support Cython 3#3956
illume merged 1 commit into
pygame:mainfrom
matusvalo:noexcept

Conversation

@matusvalo
Copy link
Copy Markdown
Contributor

@matusvalo matusvalo commented Jul 11, 2023

Fixes #3938

This PR marks functions not returning exception with noexcept keyword. This is necessary in Cython 3, since the semantics of exception handling is changed [1]. This PR needs at least Cython 0.29.31. This PR is safe for Cython >=
0.29.31 because noexcept keyword is ignored in Cython 0.29.X.

[1] https://cython.readthedocs.io/en/latest/src/userguide/migrating_to_cy30.html#exception-values-and-noexcept
[2] https://github.com/cython/cython/blob/master/CHANGES.rst#02931-2022-07-27

Note: Cython even with this PR cannot compile pygame due bug cython/cython#5524

Copy link
Copy Markdown
Member

@illume illume left a comment

Choose a reason for hiding this comment

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

Thank you. 👍

It seems cython/cython#5524 is fixed now and out in rc2. It compiles and tests ok with the testing I did with it.

@illume illume merged commit 3768a48 into pygame:main Jul 16, 2023
@matusvalo matusvalo deleted the noexcept branch July 16, 2023 11:19
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.

Cython 3.0.0b3 failure: src_c/cython/pygame/_sdl2/mixer.pyx:45:27: Cannot assign type 'mixcallback' to 'void (*)(void *, Uint8 *, int) noexcept nogil'

2 participants