diff --git a/src/pythonize.cpp b/src/pythonize.cpp index d8fb038..9d41f69 100644 --- a/src/pythonize.cpp +++ b/src/pythonize.cpp @@ -42,8 +42,12 @@ Pythonize::Pythonize () 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 ()) { pythonInit = 0; @@ -51,9 +55,6 @@ Pythonize::Pythonize () } if (debug) printf ("Python interpreter initialized!\n\n"); - - // free the lock - PyEval_ReleaseLock(); } }