]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
First test OK for DataArrayDouble.
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 2 Mar 2015 11:28:01 +0000 (12:28 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Mon, 2 Mar 2015 11:28:01 +0000 (12:28 +0100)
src/MEDCoupling_Swig/MEDCouplingMemArray.i

index 4aefb73275043eacf8e73aa3bc725e150347187c..d7ec98b1dba2d4b67d5ae01a4b621f4575b583a6 100644 (file)
@@ -2182,12 +2182,20 @@ namespace ParaMEDMEM
         static const char MSG[]="DataArrayDouble.__new__ : the args in input is expected to be a tuple of size 2 !";
         if(!PyTuple_Check(args))
           throw INTERP_KERNEL::Exception(MSG);
-        PyObject *globals(PyEval_GetGlobals());//borrowed
-        PyObject *builtins(PyDict_GetItemString(globals,"__builtins__"));//borrowed
-        PyObject *obj(PyObject_GetAttrString(builtins,"object"));
+        //PyObject *globals(PyEval_GetGlobals());//borrowed
+        //PyObject *builtins(PyDict_GetItemString(globals,"__builtins__"));//borrowed
+        //PyObject *builtinsd(PyModule_GetDict(builtins));//borrowed
+        PyObject *builtinsd(PyEval_GetBuiltins());//borrowed
+        PyObject *obj(PyDict_GetItemString(builtinsd,"object"));//borrowed
+        //PyObject *obj(PyObject_GetAttrString(builtins,"object"));
         PyObject *selfMeth(PyObject_GetAttrString(obj,"__new__"));
-        Py_DECREF(obj);
-        PyObject *instance(PyObject_CallObject(selfMeth,PyTuple_GetItem(args,0)));
+        //Py_DECREF(obj);
+        /////
+        PyObject *tmp0(PyTuple_New(1));
+        PyTuple_SetItem(tmp0,0,PyTuple_GetItem(args,0)); Py_DECREF(PyTuple_GetItem(args,0));
+        PyObject *instance(PyObject_CallObject(selfMeth,tmp0));
+        Py_DECREF(tmp0);
+        /////
         Py_DECREF(selfMeth);
         PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
         if(PyTuple_Size(args)==2 && PyDict_Check(PyTuple_GetItem(args,1)))