spack/var/spack/repos/builtin/packages/clingo/PyEval_InitThreads.patch
Harmen Stoppels f17e76e9d8
clingo: fix build with Python 3.13+ (#46775)
Python 3.9 deprecated `PyEval_InitThreads` and kept it as a no-op, and
Python 3.13 deleted the function.

The patch removes calls to it.
2024-10-04 13:26:15 +02:00

13 lines
434 B
Diff

diff --git a/libpyclingo/pyclingo.cc b/libpyclingo/pyclingo.cc
index ec4a33c6..ee903cd0 100644
--- a/libpyclingo/pyclingo.cc
+++ b/libpyclingo/pyclingo.cc
@@ -10463,7 +10463,6 @@ void addEmptyClass(Reference module, char const *name) {
PyObject *initclingo_() {
PY_TRY {
- if (!PyEval_ThreadsInitialized()) { PyEval_InitThreads(); }
#if PY_MAJOR_VERSION >= 3
Object m = PyModule_Create(&clingoModule);
#else