Do not use obsolete PyEval_InitThreads() for Python > 3.6:
../../source3/libsmb/pylibsmb.c: In function ‘py_cli_state_setup_mt_ev’:
../../source3/libsmb/pylibsmb.c:271:9: warning: ‘PyEval_InitThreads’ is
deprecated [-Wdeprecated-declarations]
271 | PyEval_InitThreads();
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.11/Python.h:95,
from ../../source3/libsmb/pylibsmb.c:48:
/usr/include/python3.11/ceval.h:132:37: note: declared here
132 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Wed Mar 12 04:36:21 UTC 2025 on atb-devel-224
goto fail;
}
+#if PY_VERSION_HEX < 0x03070000
+ /*
+ * Should be explicitly called in 3.6 and older, see
+ * https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads
+ */
PyEval_InitThreads();
+#endif
ret = pthread_create(&t->id, NULL, py_cli_state_poll_thread, self);
if (ret != 0) {