-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
C API: Remove PyEval_AcquireLock() and PyEval_InitThreads() functions #105182
Labels
Comments
vstinner
added a commit
to vstinner/cpython
that referenced
this issue
Jun 1, 2023
Remove functions in the C API: * PyEval_AcquireLock() * PyEval_ReleaseLock() * PyEval_InitThreads() * PyEval_ThreadsInitialized() But keep these functions in the stable ABI.
musicinmybrain
added a commit
to musicinmybrain/grpc
that referenced
this issue
Nov 2, 2023
Since Python 3.7, it’s called by Py_Initialize and doesn’t need to be called manually, so this removal has no effect. Since Python 3.9, it does nothing, and in Python 3.13, it will be removed, which makes this change necessary. References: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads python/cpython#105182
musicinmybrain
added a commit
to musicinmybrain/grpc
that referenced
this issue
Nov 2, 2023
Since Python 3.7, it’s called by Py_Initialize and doesn’t need to be called manually, so this removal has no effect. Since Python 3.9, it does nothing, and in Python 3.13, it will be removed, which makes this change necessary. References: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads python/cpython#105182
gnossen
pushed a commit
to grpc/grpc
that referenced
this issue
Nov 2, 2023
Since Python 3.7, it’s called by [`Py_Initialize`](https://docs.python.org/3/c-api/init.html#c.Py_Initialize) and doesn’t need to be called manually, so this removal has no effect. Since Python 3.9, it does nothing, and in [Python 3.13](https://docs.python.org/3.13/whatsnew/3.13.html), it [will be removed](python/cpython#105182), which makes this change necessary. References: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads python/cpython#105182 ---- Together with the changes discussed in #33918 and with a [Cython fix](cython/cython#5791) to be released in 3.0.5, this allowed us to build and test our `grpc` package with Python 3.13.0a1 and Cython 3.0.4. <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. -->
yarda
added a commit
to yarda/urh
that referenced
this issue
Apr 4, 2024
According to https://docs.python.org/3.13/whatsnew/3.13.html: Remove PyEval_InitThreads() and PyEval_ThreadsInitialized() functions, deprecated in Python 3.9. Since Python 3.7, Py_Initialize() always creates the GIL: calling PyEval_InitThreads() did nothing and PyEval_ThreadsInitialized() always returned non-zero. (Contributed by Victor Stinner in python/cpython#105182.) If support for < python-3.7 is required, conditionals have to be added Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
jopohl
pushed a commit
to jopohl/urh
that referenced
this issue
Apr 6, 2024
According to https://docs.python.org/3.13/whatsnew/3.13.html: Remove PyEval_InitThreads() and PyEval_ThreadsInitialized() functions, deprecated in Python 3.9. Since Python 3.7, Py_Initialize() always creates the GIL: calling PyEval_InitThreads() did nothing and PyEval_ThreadsInitialized() always returned non-zero. (Contributed by Victor Stinner in python/cpython#105182.) If support for < python-3.7 is required, conditionals have to be added Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Since 3.7,
PyEval_ThreadsInitialized()
always returns non-zero and callingPyEval_InitThreads()
is useless:Py_Initialize()
now always creates the GIL. These functions were deprecated in Python 3.9 by PR #18892 (commit b4698ec) of issue #84058. What's New in Python 3.9:Well, the removal missed Python 3.11.
PyEval_AcquireLock()
andPyEval_ReleaseLock()
don't update the current thread state and were deprecated in Python 3.2 by issue #55122:The commit ebeb903 adds this entry to What's New in Python 3.2:
I propose to now removed these 4 deprecated functions.
In 2020, I already proposed to remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions in https://bugs.python.org/issue39998 But I closed my issue when I discovered that they were part of the stable ABI. This is way to keep these functions in the stable ABI and remove them in the C API.
Linked PRs
The text was updated successfully, but these errors were encountered: