When building Jep 4.0 with Python 3.10, the following warning is produced:
src/main/c/Jep/pyembed.c: In function ‘pyembed_startup’:
src/main/c/Jep/pyembed.c:398:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
PyEval_InitThreads();
^~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/python3.10/Python.h:144,
from src/main/c/Include/jep_platform.h:35,
from src/main/c/Include/Jep.h:35,
from src/main/c/Jep/pyembed.c:44:
/usr/local/include/python3.10/ceval.h:122:37: note: declared here
Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
^~~~~~~~~~~~~~~~~~
Update the code to not have the deprecation warning with newer versions of Python. This may require the use of macros like #IF PY_MINOR_VERSION > 8 depending on how old of versions of Python we're supporting, I'm not sure.
The documentation says this method will be removed in Python 3.11 so this should be targeted for Jep 4.1.0 at the latest or 4.0.x if there is an earlier release.
When building Jep 4.0 with Python 3.10, the following warning is produced:
The documentation also points this out: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
Update the code to not have the deprecation warning with newer versions of Python. This may require the use of macros like
#IF PY_MINOR_VERSION > 8
depending on how old of versions of Python we're supporting, I'm not sure.The documentation says this method will be removed in Python 3.11 so this should be targeted for Jep 4.1.0 at the latest or 4.0.x if there is an earlier release.