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 build errors with Python 3.13 #5208

Open
wants to merge 1 commit into
base: v3.2.x
Choose a base branch
from

Conversation

antoniotorresm
Copy link

According to 1, the PyEval_InitThreads() (deprecated 3.9), PyEval_AcquireLock() and PyEval_ReleaseLock() (deprecated 3.2). functions, are removed in Python 3.13. Py_SetProgramName() is deprecated since 3.11 as well.

PyEval_InitThreads can be deleted if running Python >= 3.10 as it simply does nothing from Python 3.9 2.

Lock functions are replaced with PyEval_RestoreThread and PyEval_SaveThread as advised by Python docs 3, 4.

As for Py_SetProgramName, it should be replaced with PyConfig. The config is isolated to replicate behavior of InitializeEx 5.

According to [1], the `PyEval_InitThreads()` (deprecated 3.9), `PyEval_AcquireLock()` and
`PyEval_ReleaseLock()` (deprecated 3.2). functions, are removed in Python 3.13. `Py_SetProgramName()`
is deprecated since 3.11 as well.

`PyEval_InitThreads` can be deleted if running Python >= 3.10 as it simply does
nothing from Python 3.9 [2].

Lock functions are replaced with `PyEval_RestoreThread` and
`PyEval_SaveThread` as advised by Python docs [3], [4].

As for `Py_SetProgramName`, it should be replaced with PyConfig. The
config is isolated to replicate behavior of `InitializeEx` [5].

[1]: https://docs.python.org/3.13/whatsnew/3.13.html
[2]: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
[3]: https://docs.python.org/3/c-api/init.html#c.PyEval_AcquireLock
[4]: https://docs.python.org/3/c-api/init.html#c.PyEval_ReleaseLock
[5]: https://docs.python.org/3/c-api/init_config.html#isolated-configuration
alandekok added a commit that referenced this pull request Jan 18, 2024
@alandekok
Copy link
Member

I've done some formatting and cleanups. Please double-check.

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

2 participants