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)))