Avoid using deprecated API in CPython 3.9#2253
Merged
Merged
Conversation
bstaletic
commented
Jun 15, 2020
| internals_ptr = new internals(); | ||
| #if defined(WITH_THREAD) | ||
| PyEval_InitThreads(); | ||
| #if PY_VERSION_HEX >= 0x03090000 |
Collaborator
Author
There was a problem hiding this comment.
I accidentally first wrote 0x03080000 here and it broke the tests, even though the CPython docs say that PyEval_InitThreads() doesn't do anything ever since 3.7.
This only makes me less certain that this pull request actually works.
bstaletic
force-pushed
the
py39
branch
2 times, most recently
from
June 18, 2020 17:38
b18c075 to
101dc49
Compare
The PyEval_InitThreads() and PyEval_ThreadsInitialized() functions are now deprecated and will be removed in Python 3.11. Calling PyEval_InitThreads() now does nothing. The GIL is initialized by Py_Initialize() since Python 3.7.
trixirt
approved these changes
Jun 25, 2020
trixirt
left a comment
There was a problem hiding this comment.
I ran into this build problem on fedora rawhide, which uses 3.9.
I have reviewed the docs, this call should not be necessary.
And this change fixes the problem
Member
|
Thanks @bstaletic. I didn't quite follow your comment above, but I'll merge this for now (and we can revisit if problems do arise.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PyEval_InitThreads()will be deprecated once python 3.9 is released.This is a quote from the what's new page. Considering the advanced capabilities of pybind11, with regards to GIL, I don't know if this is the right thing to do about this deprecation.