Fix initialization of the python interpreter. This was causing runtime SEGV in tde-guidance

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/9/head
Michele Calgaro 1 year ago
parent e55e706f31
commit e0c6c2a79a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -42,8 +42,12 @@ Pythonize::Pythonize ()
if (!Py_IsInitialized ()) if (!Py_IsInitialized ())
{ {
PyEval_InitThreads (); Py_Initialize();
Py_Initialize ();
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION <= 6
// initialize thread support
PyEval_InitThreads();
#endif
if (!Py_IsInitialized ()) if (!Py_IsInitialized ())
{ {
pythonInit = 0; pythonInit = 0;
@ -51,9 +55,6 @@ Pythonize::Pythonize ()
} }
if (debug) printf ("Python interpreter initialized!\n\n"); if (debug) printf ("Python interpreter initialized!\n\n");
// free the lock
PyEval_ReleaseLock();
} }
} }

Loading…
Cancel
Save