Blob Blame History Raw
Index: b/kpythonpluginfactory/kpythonpluginfactory.cpp
===================================================================
--- a/kpythonpluginfactory/kpythonpluginfactory.cpp
+++ b/kpythonpluginfactory/kpythonpluginfactory.cpp
@@ -33,6 +33,12 @@
 #define PY3
 #endif
 
+#if PY_MAJOR_VERSION >= 3
+#if PY_MINOR_VERSION >= 2
+#define PY3.2
+#endif
+#endif
+
 /*
 This implements a plugin factory for running Python plugins. It also
 supports io-slaves with a kdemain() entry point.
@@ -106,8 +112,13 @@ void KPythonPluginFactory::initialize()
         kDebug() << "Initializing Python interpreter.";
         pythonLib = LoadPythonLibrary();
 
+#ifdef PY3.2
+        Py_Initialize ();
+        PyEval_InitThreads ();
+#else
         PyEval_InitThreads ();
         Py_Initialize ();
+#endif
         if (!Py_IsInitialized ())
         {
             //pythonInit = 0;
@@ -117,8 +128,10 @@ void KPythonPluginFactory::initialize()
         kDebug() << "Succesfully initialized Python interpreter.";
 
         threadState = PyThreadState_GET();
+#ifndef PY3.2
         // free the lock
         PyEval_ReleaseLock();
+#endif
     }
 }