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

tf: account for Python GIL explicit initialization deprecation from Python 3.7 to 3.9 #1909

Conversation

mattyjams
Copy link
Contributor

Description of Change(s)

Starting with Python 3.7, the GIL is initialized as part of Py_Initialize() and PyEval_InitThreads() no longer needs to be called separately. In Python 3.9, PyEval_InitThreads() no longer does anything and was marked deprecated.

See here for more detail:
https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads

This change avoids the use of PyEval_InitThreads() and PyEval_ThreadsInitialized() when building against Python 3.7 or later and cleans up the deprecation warnings that are otherwise issued. Those functions are slated for removal in Python 3.11.

  • [ X ] I have submitted a signed Contributor License Agreement

…ython 3.7 to 3.9

Starting with Python 3.7, the GIL is initialized as part of Py_Initialize() and
PyEval_InitThreads() no longer needs to be called separately. In Python 3.9,
PyEval_InitThreads() no longer does anything and was marked deprecated.

See here for more detail:
https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads

This change avoids the use of PyEval_InitThreads() and
PyEval_ThreadsInitialized() when building against Python 3.7 or later.
@jilliene
Copy link

Filed as internal issue #USD-7439

@pixar-oss pixar-oss merged commit bebcab6 into PixarAnimationStudios:dev Sep 20, 2022
@mattyjams mattyjams deleted the pr/tf_PyEval_InitThreads_deprecation branch September 20, 2022 05:52
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.

3 participants