Salome HOME
Merge Python 3 porting.
[modules/yacs.git] / src / runtime / DistributedPythonNode.cxx
index 8a2ccd7a71f93307a684e328290e467e6f0f2b08..bf78b6d30d9f462f34ba995814133d778b86f76f 100644 (file)
@@ -72,7 +72,7 @@ void DistributedPythonNode::load()
         _errorDetails=msg.str();
         throw Exception(msg.str());
       }
-    const char picklizeScript[]="import cPickle\ndef pickleForDistPyth2009(*args,**kws):\n  return cPickle.dumps((args,kws),-1)\n\ndef unPickleForDistPyth2009(st):\n  args=cPickle.loads(st)\n  return args\n";
+    const char picklizeScript[]="import pickle\ndef pickleForDistPyth2009(*args,**kws):\n  return pickle.dumps((args,kws),-1)\n\ndef unPickleForDistPyth2009(st):\n  args=pickle.loads(st)\n  return args\n";
     PyObject *res=PyRun_String(picklizeScript,Py_file_input,_context,_context);
     if(res == NULL)
       {
@@ -180,7 +180,7 @@ void DistributedPythonNode::execute()
         PyTuple_SetItem(args,pos,ob);
       }
     PyObject *serializationInput=PyObject_CallObject(_pyfuncSer,args);
-    std::string serializationInputC=PyString_AsString(serializationInput);
+    std::string serializationInputC=PyBytes_AsString(serializationInput);
     serializationInputCorba=new Engines::pickledArgs;
     int len=serializationInputC.length();
     serializationInputCorba->length(serializationInputC.length());
@@ -212,7 +212,7 @@ void DistributedPythonNode::execute()
   {
     AutoGIL agil;
     args = PyTuple_New(1);
-    PyObject* resultPython=PyString_FromString(resultCorbaC);
+    PyObject* resultPython=PyBytes_FromString(resultCorbaC);
     delete [] resultCorbaC;
     PyTuple_SetItem(args,0,resultPython);
     PyObject *finalResult=PyObject_CallObject(_pyfuncUnser,args);
@@ -237,7 +237,7 @@ void DistributedPythonNode::execute()
           {
             OutputPyPort *p=(OutputPyPort *)*iter;
             DEBTRACE( "port name: " << p->getName() );
-            DEBTRACE( "port kind: " << p->edGetType()->kind() );
+            DEBTRACE( "port kind: " << p->typeName() );
             DEBTRACE( "port pos : " << pos );
             if(PyTuple_Check(finalResult))ob=PyTuple_GetItem(finalResult,pos) ;
             else ob=finalResult;