]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
[PY3] Add SWIG things
authorNicolas Geimer <nicolas.geimer@edf.fr>
Tue, 28 Mar 2017 11:45:16 +0000 (13:45 +0200)
committerNicolas Geimer <nicolas.geimer@edf.fr>
Tue, 28 Mar 2017 11:45:16 +0000 (13:45 +0200)
16 files changed:
doc/tutorial/conf.py.in
src/MEDCoupling_Swig/CMakeLists.txt
src/MEDCoupling_Swig/MEDCouplingCommon.i
src/MEDCoupling_Swig/MEDCouplingDataArrayTypemaps.i
src/MEDCoupling_Swig/MEDCouplingFieldDiscretization.i
src/MEDCoupling_Swig/MEDCouplingMemArray.i
src/MEDCoupling_Swig/MEDCouplingRemapper.i
src/MEDLoader/Swig/CMakeLists.txt
src/MEDLoader/Swig/MEDLoaderCommon.i
src/MEDLoader/Swig/MEDLoaderTypemaps.i
src/MEDPartitioner_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/ParaMEDMEM.i
src/ParaMEDMEM_Swig/ParaMEDMEM.typemap
src/RENUMBER_Swig/CMakeLists.txt
src/RENUMBER_Swig/MEDRenumberCommon.i

index 786d669b80fdc900985f2654007def92d5eac7f3..3d84ae9bb3f1340c6b6e39fbb52366c5023754a3 100644 (file)
@@ -3,7 +3,7 @@
 # Code Coupling and Code Integration documentation build configuration file, created by
 # sphinx-quickstart on Tue Apr 28 15:28:57 2009.
 #
-# This file is execfile()d with the current directory set to its containing dir.
+# This file is exec(open(file).read())d with the current directory set to its containing dir.
 #
 # The contents of this file are pickled, so don't put values in the namespace
 # that aren't pickleable (module imports are okay, they're removed automatically).
index 03ee9d80679c7e883a5e868ed20a9c9c9112c404..5f68bd625dbcab91988ffde4c79813f0e4e0cfff 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(${SWIG_USE_FILE})
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_FLAGS "-py3")
 SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
 
 SET (MEDCoupling_SWIG_DPYS_FILES
@@ -90,7 +90,7 @@ SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i)
 SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcoupling)
 
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_FLAGS "-py3")
 SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
 
 # _ABR_ Ensure dependency mechanism on all SWIG files and headers
index bad2f7127fe76d6cf77f03aea8db794bee8ef0e1..fcbb4a16c23356d35d5a0482f3de0ee115e76306 100644 (file)
@@ -887,7 +887,7 @@ namespace MEDCoupling
            if(arr)
              obj1=SWIG_NewPointerObj(SWIG_as_voidptr(arr),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
            else
-             obj1=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(b));
+             obj1=PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(b));
            PyTuple_SetItem(res,0,obj0);
            PyTuple_SetItem(res,1,obj1);
            return res;
@@ -998,7 +998,7 @@ namespace MEDCoupling
            std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
            PyObject *res=PyList_New(result.size());
            for(int i=0;iL!=result.end(); i++, iL++)
-             PyList_SetItem(res,i,PyInt_FromLong(*iL));
+             PyList_SetItem(res,i,PyLong_FromLong(*iL));
            return res;
          }
 
@@ -1541,7 +1541,7 @@ namespace MEDCoupling
              DataArrayInt *ret0=self->getNodeIdsInUse(ret1);
              PyObject *ret=PyTuple_New(2);
              PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-             PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+             PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
              return ret;
            }
 
@@ -1727,7 +1727,7 @@ namespace MEDCoupling
           const int *r=self->getAllConn(ret2);
           PyObject *ret=PyTuple_New(ret2);
           for(int i=0;i<ret2;i++)
-            PyTuple_SetItem(ret,i,PyInt_FromLong(r[i]));
+            PyTuple_SetItem(ret,i,PyLong_FromLong(r[i]));
           return ret;
         }
       }
@@ -1916,7 +1916,7 @@ namespace MEDCoupling
         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
         PyObject *res=PyList_New(result.size());
         for(int i=0;iL!=result.end(); i++, iL++)
-          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+          PyList_SetItem(res,i,PyLong_FromLong(*iL));
         return res;
       }
       
@@ -2086,7 +2086,7 @@ namespace MEDCoupling
         DataArrayInt *ret0=MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed(seedPtr,seedPtr+szArr,arrIn,arrIndxIn,nbOfDepthPeeling,nbOfDepthPeelingPerformed);
         PyObject *res=PyTuple_New(2);
         PyTuple_SetItem(res,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-        PyTuple_SetItem(res,1,PyInt_FromLong(nbOfDepthPeelingPerformed));
+        PyTuple_SetItem(res,1,PyLong_FromLong(nbOfDepthPeelingPerformed));
         return res;
       }
 
@@ -2114,7 +2114,7 @@ namespace MEDCoupling
         double ret0=self->distanceToPoint(pt,pt+nbOfCompo,cellId);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(cellId));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(cellId));
         return ret;
       }
 
@@ -2136,7 +2136,7 @@ namespace MEDCoupling
         PyObject *ret=PyTuple_New(3);
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__MEDCoupling1SGTUMesh, SWIG_POINTER_OWN | 0 ));
         PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(ret1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-        PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
+        PyTuple_SetItem(ret,2,PyLong_FromLong(ret2));
         return ret;
       }
       
@@ -2416,13 +2416,12 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : the first param is not a pyslice !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sliC=reinterpret_cast<PySliceObject *>(slic);
         if(!arrIndxIn)
           throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : last array is null !");
         arrIndxIn->checkAllocated();
         if(arrIndxIn->getNumberOfComponents()!=1)
           throw INTERP_KERNEL::Exception("ExtractFromIndexedArraysSlice (wrap) : number of components of last argument must be equal to one !");
-        GetIndicesOfSlice(sliC,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
+        GetIndicesOfSlice(slic,arrIndxIn->getNumberOfTuples(),&strt,&stp,&step,"ExtractFromIndexedArraysSlice (wrap) : Invalid slice regarding nb of elements !");
         DataArrayInt *arrOut=0,*arrIndexOut=0;
         MEDCouplingUMesh::ExtractFromIndexedArraysSlice(strt,stp,step,arrIn,arrIndxIn,arrOut,arrIndexOut);
         PyObject *ret=PyTuple_New(2);
@@ -2741,7 +2740,7 @@ namespace MEDCoupling
         std::set<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
         PyObject *res = PyList_New(result.size());
         for (int i=0;iL!=result.end(); i++, iL++)
-          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+          PyList_SetItem(res,i,PyLong_FromLong(*iL));
         return res;
       }
 
@@ -3313,8 +3312,8 @@ namespace MEDCoupling
         for(std::size_t i=0;i<ret.size();i++)
           {
             PyObject *tmp=PyTuple_New(2);
-            PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
-            PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+            PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+            PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
             PyList_SetItem(retPy,i,tmp);
           }
         return retPy;
@@ -3330,8 +3329,8 @@ namespace MEDCoupling
         for(std::size_t i=0;i<ret.size();i++)
           {
             PyObject *tmp=PyTuple_New(2);
-            PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
-            PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+            PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+            PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
             PyList_SetItem(retPy,i,tmp);
           }
         return retPy;
@@ -3363,8 +3362,8 @@ namespace MEDCoupling
         for(std::size_t i=0;i<partCompactFormat.size();i++)
           {
             PyObject *tmp4=PyTuple_New(2);
-            PyTuple_SetItem(tmp4,0,PyInt_FromLong(partCompactFormat[i].first));
-            PyTuple_SetItem(tmp4,1,PyInt_FromLong(partCompactFormat[i].second));
+            PyTuple_SetItem(tmp4,0,PyLong_FromLong(partCompactFormat[i].first));
+            PyTuple_SetItem(tmp4,1,PyLong_FromLong(partCompactFormat[i].second));
             PyList_SetItem(ret1Py,i,tmp4);
           }
         PyTuple_SetItem(ret,1,ret1Py);
@@ -3381,8 +3380,8 @@ namespace MEDCoupling
         for(std::size_t i=0;i<ret.size();i++)
           {
             PyObject *tmp(PyTuple_New(2));
-            PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
-            PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+            PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+            PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
             PyList_SetItem(retPy,i,tmp);
           }
         return retPy;
@@ -3397,8 +3396,8 @@ namespace MEDCoupling
         for(std::size_t i=0;i<ret.size();i++)
           {
             PyObject *tmp(PyTuple_New(2));
-            PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
-            PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+            PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+            PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
             PyList_SetItem(retPy,i,tmp);
           }
         return retPy;
@@ -3422,8 +3421,8 @@ namespace MEDCoupling
         for(std::size_t i=0;i<ret.size();i++)
           {
             PyObject *tmp(PyTuple_New(2));
-            PyTuple_SetItem(tmp,0,PyInt_FromLong(ret[i].first));
-            PyTuple_SetItem(tmp,1,PyInt_FromLong(ret[i].second));
+            PyTuple_SetItem(tmp,0,PyLong_FromLong(ret[i].first));
+            PyTuple_SetItem(tmp,1,PyLong_FromLong(ret[i].second));
             PyList_SetItem(retPy,i,tmp);
           }
         return retPy;
@@ -3771,7 +3770,7 @@ namespace MEDCoupling
           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
         else
           {
-            PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
+            PyObject *res1=PySlice_New(PyLong_FromLong(bb),PyLong_FromLong(ee),PyLong_FromLong(ss));
             PyTuple_SetItem(res,1,res1);
           }
         return res;
@@ -5045,7 +5044,7 @@ namespace MEDCoupling
           {// NOT general case. only true if in unpickeling context ! call __init__. Because for all other cases, __init__ is called right after __new__ !
             PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
             ////
-            PyObject *a(PyInt_FromLong(0));
+            PyObject *a(PyLong_FromLong(0));
             PyObject *uniqueElt(PyDict_GetItem(PyTuple_GetItem(args,1),a));
             Py_DECREF(a);
             if(!uniqueElt)
@@ -5066,7 +5065,7 @@ namespace MEDCoupling
         PyObject *ret(PyTuple_New(1));
         PyObject *ret0(PyDict_New());
         {
-          PyObject *a(PyInt_FromLong(0)),*b(PyInt_FromLong(self->getTypeOfField())),*c(PyInt_FromLong(self->getTimeDiscretization()));
+          PyObject *a(PyLong_FromLong(0)),*b(PyLong_FromLong(self->getTypeOfField())),*c(PyLong_FromLong(self->getTimeDiscretization()));
           PyObject *d(PyTuple_New(2)); PyTuple_SetItem(d,0,b); PyTuple_SetItem(d,1,c);
           PyDict_SetItem(ret0,a,d);
           Py_DECREF(a); Py_DECREF(d);
@@ -5376,10 +5375,10 @@ namespace MEDCoupling
           int meshId,arrId,arrIdInField,fieldId;
           self->getIdsOnTimeRight(tm,meshId,arrId,arrIdInField,fieldId);
           PyObject *res=PyList_New(4);
-          PyList_SetItem(res,0,PyInt_FromLong(meshId));
-          PyList_SetItem(res,1,PyInt_FromLong(arrId));
-          PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
-          PyList_SetItem(res,3,PyInt_FromLong(fieldId));
+          PyList_SetItem(res,0,PyLong_FromLong(meshId));
+          PyList_SetItem(res,1,PyLong_FromLong(arrId));
+          PyList_SetItem(res,2,PyLong_FromLong(arrIdInField));
+          PyList_SetItem(res,3,PyLong_FromLong(fieldId));
           return res;
         }
 
@@ -5388,10 +5387,10 @@ namespace MEDCoupling
           int meshId,arrId,arrIdInField,fieldId;
           self->getIdsOnTimeLeft(tm,meshId,arrId,arrIdInField,fieldId);
           PyObject *res=PyList_New(4);
-          PyList_SetItem(res,0,PyInt_FromLong(meshId));
-          PyList_SetItem(res,1,PyInt_FromLong(arrId));
-          PyList_SetItem(res,2,PyInt_FromLong(arrIdInField));
-          PyList_SetItem(res,3,PyInt_FromLong(fieldId));
+          PyList_SetItem(res,0,PyLong_FromLong(meshId));
+          PyList_SetItem(res,1,PyLong_FromLong(arrId));
+          PyList_SetItem(res,2,PyLong_FromLong(arrIdInField));
+          PyList_SetItem(res,3,PyLong_FromLong(fieldId));
           return res;
         }
       }
@@ -5954,6 +5953,6 @@ namespace MEDCoupling
 import os
 __filename=os.environ.get('PYTHONSTARTUP')
 if __filename and os.path.isfile(__filename):
-  execfile(__filename)
+  exec(open(__filename).read())
   pass
 %}
index 8cb326457a0aecbfe9be8f1a0e537dd50298ecf2..bf9b1a82a5752ed6a31d092f262c9365dfcec88c 100644 (file)
@@ -29,7 +29,7 @@
  * This method is an extention of PySlice_GetIndices but less
  * open than PySlice_GetIndicesEx that accepts too many situations.
  */
-void GetIndicesOfSlice(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
+void GetIndicesOfSlice(PyObject *slice, Py_ssize_t length, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
 {
   int ret(PySlice_GetIndices(slice,length,start,stop,step));
   if(ret==0)
@@ -42,7 +42,7 @@ void GetIndicesOfSlice(PySliceObject *slice, Py_ssize_t length, Py_ssize_t *star
 /*!
  * This method allows to retrieve slice info from \a slice.
  */
-void GetIndicesOfSliceExplicitely(PySliceObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
+void GetIndicesOfSliceExplicitely(PyObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, const char *msgInCaseOfFailure)
 {
   int ret(PySlice_GetIndices(slice,std::numeric_limits<int>::max(),start,stop,step));
   if(ret==0)
@@ -571,7 +571,7 @@ PyObject *ToCSRMatrix(const std::vector<std::map<int,double> >& m, int nbCols) t
   //
   PyObject *args(PyTuple_New(1)),*args0(PyTuple_New(3)),*kw(PyDict_New()),*kw1(PyTuple_New(2));
   PyTuple_SetItem(args0,0,a); PyTuple_SetItem(args0,1,b); PyTuple_SetItem(args0,2,c); PyTuple_SetItem(args,0,args0);
-  PyTuple_SetItem(kw1,0,PyInt_FromLong(nbRows)); PyTuple_SetItem(kw1,1,PyInt_FromLong(nbCols));
+  PyTuple_SetItem(kw1,0,PyLong_FromLong(nbRows)); PyTuple_SetItem(kw1,1,PyLong_FromLong(nbCols));
   PyObject *tmp1(PyString_FromString("shape"));
   PyDict_SetItem(kw,tmp1,kw1); Py_DECREF(tmp1); Py_DECREF(kw1);
   PyObject* pdict=PyDict_New();
@@ -631,7 +631,7 @@ static PyObject *convertIntArrToPyList(const int *ptr, int size) throw(INTERP_KE
 {
   PyObject *ret=PyList_New(size);
   for(int i=0;i<size;i++)
-    PyList_SetItem(ret,i,PyInt_FromLong(ptr[i]));
+    PyList_SetItem(ret,i,PyLong_FromLong(ptr[i]));
   return ret;
 }
 
@@ -640,7 +640,7 @@ static PyObject *convertIntArrToPyList2(const std::vector<int>& v) throw(INTERP_
   int size=v.size();
   PyObject *ret=PyList_New(size);
   for(int i=0;i<size;i++)
-    PyList_SetItem(ret,i,PyInt_FromLong(v[i]));
+    PyList_SetItem(ret,i,PyLong_FromLong(v[i]));
   return ret;
 }
 
@@ -650,7 +650,7 @@ static PyObject *convertIntArrToPyList3(const std::set<int>& v) throw(INTERP_KER
   PyObject *ret=PyList_New(size);
   std::set<int>::const_iterator it=v.begin();
   for(int i=0;i<size;i++,it++)
-    PyList_SetItem(ret,i,PyInt_FromLong(*it));
+    PyList_SetItem(ret,i,PyLong_FromLong(*it));
   return ret;
 }
 
@@ -661,7 +661,7 @@ static PyObject *convertIntArrToPyListOfTuple(const int *vals, int nbOfComp, int
     {
       PyObject *t=PyTuple_New(nbOfComp);
       for(int j=0;j<nbOfComp;j++)
-        PyTuple_SetItem(t,j,PyInt_FromLong(vals[i*nbOfComp+j]));
+        PyTuple_SetItem(t,j,PyLong_FromLong(vals[i*nbOfComp+j]));
       PyList_SetItem(ret,i,t);
     }
   return ret;
@@ -676,9 +676,9 @@ static int *convertPyToNewIntArr2(PyObject *pyLi, int *size) throw(INTERP_KERNEL
       for(int i=0;i<*size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               tmp[i]=val;
             }
           else
@@ -696,9 +696,9 @@ static int *convertPyToNewIntArr2(PyObject *pyLi, int *size) throw(INTERP_KERNEL
       for(int i=0;i<*size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               tmp[i]=val;
             }
           else
@@ -721,8 +721,8 @@ static PyObject *convertFromVectorPairInt(const std::vector< std::pair<int,int>
   for(std::size_t i=0;i<arr.size();i++)
     {
       PyObject *t=PyTuple_New(2);
-      PyTuple_SetItem(t,0,PyInt_FromLong(arr[i].first));
-      PyTuple_SetItem(t,1,PyInt_FromLong(arr[i].second));
+      PyTuple_SetItem(t,0,PyLong_FromLong(arr[i].first));
+      PyTuple_SetItem(t,1,PyLong_FromLong(arr[i].second));
       PyList_SetItem(ret,i,t);
     }
   return ret;
@@ -744,13 +744,13 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
-              if(!PyInt_Check(o_0))
+              if(!PyLong_Check(o_0))
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_1=PyTuple_GetItem(o,1);
-              if(!PyInt_Check(o_1))
+              if(!PyLong_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
-              arr[i].first=(int)PyInt_AS_LONG(o_0);
-              arr[i].second=(int)PyInt_AS_LONG(o_1);
+              arr[i].first=(int)PyLong_AS_LONG(o_0);
+              arr[i].second=(int)PyLong_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -769,13 +769,13 @@ static void convertPyToVectorPairInt(PyObject *pyLi, std::vector< std::pair<int,
               if(sz2!=2)
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_0=PyTuple_GetItem(o,0);
-              if(!PyInt_Check(o_0))
+              if(!PyLong_Check(o_0))
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_1=PyTuple_GetItem(o,1);
-              if(!PyInt_Check(o_1))
+              if(!PyLong_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
-              arr[i].first=(int)PyInt_AS_LONG(o_0);
-              arr[i].second=(int)PyInt_AS_LONG(o_1);
+              arr[i].first=(int)PyLong_AS_LONG(o_0);
+              arr[i].second=(int)PyLong_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -804,10 +804,10 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
               if(!PyString_Check(o_0))
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_1=PyTuple_GetItem(o,1);
-              if(!PyInt_Check(o_1))
+              if(!PyLong_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
               arr[i].first=PyString_AsString(o_0);
-              arr[i].second=(int)PyInt_AS_LONG(o_1);
+              arr[i].second=(int)PyLong_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -829,10 +829,10 @@ static void convertPyToVectorPairStringInt(PyObject *pyLi, std::vector< std::pai
               if(!PyString_Check(o_0))
                 throw INTERP_KERNEL::Exception(msg);
               PyObject *o_1=PyTuple_GetItem(o,1);
-              if(!PyInt_Check(o_1))
+              if(!PyLong_Check(o_1))
                 throw INTERP_KERNEL::Exception(msg);
               arr[i].first=PyString_AsString(o_0);
-              arr[i].second=(int)PyInt_AS_LONG(o_1);
+              arr[i].second=(int)PyLong_AS_LONG(o_1);
             }
           else
             throw INTERP_KERNEL::Exception(msg);
@@ -851,9 +851,9 @@ static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr) throw(I
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               arr[i]=val;
             }
           else
@@ -867,9 +867,9 @@ static void convertPyToNewIntArr3(PyObject *pyLi, std::vector<int>& arr) throw(I
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               arr[i]=val;
             }
           else
@@ -893,9 +893,9 @@ static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPar
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               arr.push_back(val);
             }
           else
@@ -917,9 +917,9 @@ static void convertPyToNewIntArr4(PyObject *pyLi, int recurseLev, int nbOfSubPar
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          if(PyInt_Check(o))
+          if(PyLong_Check(o))
             {
-              int val=(int)PyInt_AS_LONG(o);
+              int val=(int)PyLong_AS_LONG(o);
               arr.push_back(val);
             }
           else
@@ -982,9 +982,9 @@ static void checkFillArrayWithPyList(int size1, int size2, int& nbOfTuples, int&
 static void fillArrayWithPyListInt3(PyObject *pyLi, int& nbOfElt, std::vector<int>& ret)
 {
   static const char MSG[]="fillArrayWithPyListInt3 : It appears that the input list or tuple is composed by elts having different sizes !";
-  if(PyInt_Check(pyLi))
+  if(PyLong_Check(pyLi))
     {
-      long val=PyInt_AS_LONG(pyLi);
+      long val=PyLong_AS_LONG(pyLi);
       if(nbOfElt==-1)
         nbOfElt=1;
       else
@@ -1138,8 +1138,8 @@ static bool fillIntVector(PyObject *pyLi, std::vector<int>& vec) throw(INTERP_KE
       for(int i=0;i<sz;i++)
         {
           PyObject *o=PyList_GetItem(pyLi,i);
-          if(PyInt_Check(o))
-            vec[i]=PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            vec[i]=PyLong_AS_LONG(o);
           else
             return false;
         }
@@ -1152,8 +1152,8 @@ static bool fillIntVector(PyObject *pyLi, std::vector<int>& vec) throw(INTERP_KE
       for(int i=0;i<sz;i++)
         {
           PyObject *o=PyTuple_GetItem(pyLi,i);
-          if(PyInt_Check(o))
-            vec[i]=PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            vec[i]=PyLong_AS_LONG(o);
           else
             return false;
         }
@@ -1307,9 +1307,9 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, int *size) throw(INTERP_KER
               double val=PyFloat_AS_DOUBLE(o);
               tmp[i]=val;
             }
-          else if(PyInt_Check(o))
+          else if(PyLong_Check(o))
             {
-              long val0=PyInt_AS_LONG(o);
+              long val0=PyLong_AS_LONG(o);
               double val=val0;
               tmp[i]=val;
             }
@@ -1333,9 +1333,9 @@ static double *convertPyToNewDblArr2(PyObject *pyLi, int *size) throw(INTERP_KER
               double val=PyFloat_AS_DOUBLE(o);
               tmp[i]=val;
             }
-          else if(PyInt_Check(o))
+          else if(PyLong_Check(o))
             {
-              long val0=PyInt_AS_LONG(o);
+              long val0=PyLong_AS_LONG(o);
               double val=val0;
               tmp[i]=val;
             }
@@ -1364,9 +1364,9 @@ static void fillArrayWithPyListDbl3(PyObject *pyLi, int& nbOfElt, std::vector<do
       double val=PyFloat_AS_DOUBLE(pyLi);
       ret.push_back(val);
     }
-  else if(PyInt_Check(pyLi))
+  else if(PyLong_Check(pyLi))
     {
-      long val0=PyInt_AS_LONG(pyLi);
+      long val0=PyLong_AS_LONG(pyLi);
       double val=val0;
       if(nbOfElt==-1)
         nbOfElt=1;
@@ -1511,9 +1511,9 @@ static void convertFromPyObjVectorOfObj(PyObject *pyLi, swig_type_info *ty, cons
 static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, MEDCoupling::DataArrayInt *& daIntTyypp, MEDCoupling::DataArrayIntTuple *&daIntTuple) throw(INTERP_KERNEL::Exception)
 {
   sw=-1;
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(int)PyLong_AS_LONG(value);
       sw=1;
       return;
     }
@@ -1524,8 +1524,8 @@ static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std:
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1542,8 +1542,8 @@ static void convertObjToPossibleCpp1(PyObject *value, int& sw, int& iTyypp, std:
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1591,9 +1591,9 @@ static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, s
       sw=1;
       return;
     }
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      iTyypp=(double)PyInt_AS_LONG(value);
+      iTyypp=(double)PyLong_AS_LONG(value);
       sw=1;
       return;
     }
@@ -1606,8 +1606,8 @@ static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, s
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
             stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
@@ -1626,8 +1626,8 @@ static void convertObjToPossibleCpp4(PyObject *value, int& sw, double& iTyypp, s
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
             stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
@@ -1665,9 +1665,9 @@ static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp,
       sw=1;
       return;
     }
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      iTyypp=(double)PyInt_AS_LONG(value);
+      iTyypp=(double)PyLong_AS_LONG(value);
       sw=1;
       return;
     }
@@ -1680,8 +1680,8 @@ static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp,
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
             stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
@@ -1700,8 +1700,8 @@ static void convertObjToPossibleCpp44(PyObject *value, int& sw, double& iTyypp,
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
             stdvecTyypp[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            stdvecTyypp[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            stdvecTyypp[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
@@ -1732,9 +1732,9 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int&
 {
   const char *msg="5 types accepted : integer, tuple of integer, list of integer, slice, DataArrayInt, DataArrayIntTuple";
   sw=-1;
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(int)PyLong_AS_LONG(value);
       sw=1;
       return;
     }
@@ -1745,8 +1745,8 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int&
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1763,8 +1763,8 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int&
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1777,8 +1777,7 @@ static void convertObjToPossibleCpp2(PyObject *value, int nbelem, int& sw, int&
   if(PySlice_Check(value))
     {
       Py_ssize_t strt=2,stp=2,step=2;
-      PySliceObject *oC=reinterpret_cast<PySliceObject *>(value);
-      GetIndicesOfSlice(oC,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
+      GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
       p.first=strt;
       p.second.first=stp;
       p.second.second=step;
@@ -1837,9 +1836,9 @@ static void convertObjToPossibleCpp2WithNegIntInterp(PyObject *value, int nbelem
 static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int& iTyypp, std::vector<int>& stdvecTyypp, std::pair<int, std::pair<int,int> >& p, MEDCoupling::DataArrayIntTuple *& daIntTyypp) throw(INTERP_KERNEL::Exception)
 {
   sw=-1;
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(int)PyLong_AS_LONG(value);
       sw=1;
       return;
     }
@@ -1850,8 +1849,8 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int&
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -1868,8 +1867,8 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int&
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -1882,8 +1881,7 @@ static void convertObjToPossibleCpp22(PyObject *value, int nbelem, int& sw, int&
   if(PySlice_Check(value))
     {
       Py_ssize_t strt=2,stp=2,step=2;
-      PySliceObject *oC=reinterpret_cast<PySliceObject *>(value);
-      GetIndicesOfSlice(oC,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
+      GetIndicesOfSlice(value,nbelem,&strt,&stp,&step,"Slice in subscriptable object DataArray invalid !");
       p.first=strt;
       p.second.first=stp;
       p.second.second=step;
@@ -2047,9 +2045,9 @@ static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, MEDC
       sw=1;
       return;
     }
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      val=(double)PyInt_AS_LONG(value);
+      val=(double)PyLong_AS_LONG(value);
       sw=1;
       return;
     }
@@ -2062,8 +2060,8 @@ static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, MEDC
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
             f[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            f[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            f[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
@@ -2082,8 +2080,8 @@ static void convertObjToPossibleCpp5(PyObject *value, int& sw, double& val, MEDC
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
             f[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            f[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            f[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
@@ -2134,13 +2132,13 @@ static const double *convertObjToPossibleCpp5_Safe(PyObject *value, int& sw, dou
         }
       return &val;
     }
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      val=(double)PyInt_AS_LONG(value);
+      val=(double)PyLong_AS_LONG(value);
       sw=1;
       if(nbTuplesExpected*nbCompExpected!=1)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyInt) !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be " << nbTuplesExpected*nbCompExpected << " , and your data in input has dimension one (single PyLong) !"; 
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
       return &val;
@@ -2242,13 +2240,13 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
       nbTuples=1;
       return &val;
     }
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      val=(double)PyInt_AS_LONG(value);
+      val=(double)PyLong_AS_LONG(value);
       sw=1;
       if(nbCompExpected!=1)
         {
-          std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyInt) !"; 
+          std::ostringstream oss; oss << msg << "dimension expected to be " << nbCompExpected << " , and your data in input has dimension one (single PyLong) !"; 
           throw INTERP_KERNEL::Exception(oss.str().c_str());
         }
       nbTuples=1;
@@ -2263,8 +2261,8 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
             f[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            f[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            f[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
@@ -2289,8 +2287,8 @@ static const double *convertObjToPossibleCpp5_Safe2(PyObject *value, int& sw, do
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
             f[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            f[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            f[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
@@ -2389,9 +2387,9 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
       nbTuples=1;
       return &val;
     }
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      val=(double)PyInt_AS_LONG(value);
+      val=(double)PyLong_AS_LONG(value);
       sw=1;
       nbTuples=1;
       return &val;
@@ -2405,8 +2403,8 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
           PyObject *o=PyTuple_GetItem(value,i);
           if(PyFloat_Check(o))
             f[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            f[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            f[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not double ! only tuples of doubles accepted or integer !";
@@ -2426,8 +2424,8 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
           PyObject *o=PyList_GetItem(value,i);
           if(PyFloat_Check(o))
             f[i]=PyFloat_AS_DOUBLE(o);
-          else if(PyInt_Check(o))
-            f[i]=(double)PyInt_AS_LONG(o);
+          else if(PyLong_Check(o))
+            f[i]=(double)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not double ! only lists of doubles accepted or integer !";
@@ -2504,9 +2502,9 @@ static const double *convertObjToPossibleCpp5_SingleCompo(PyObject *value, int&
 static const int *convertObjToPossibleCpp1_Safe(PyObject *value, int& sw, int& sz, int& iTyypp, std::vector<int>& stdvecTyypp) throw(INTERP_KERNEL::Exception)
 {
   sw=-1;
-  if(PyInt_Check(value))
+  if(PyLong_Check(value))
     {
-      iTyypp=(int)PyInt_AS_LONG(value);
+      iTyypp=(int)PyLong_AS_LONG(value);
       sw=1; sz=1;
       return &iTyypp;
     }
@@ -2517,8 +2515,8 @@ static const int *convertObjToPossibleCpp1_Safe(PyObject *value, int& sw, int& s
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyTuple_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "Tuple as been detected but element #" << i << " is not integer ! only tuples of integers accepted !";
@@ -2535,8 +2533,8 @@ static const int *convertObjToPossibleCpp1_Safe(PyObject *value, int& sw, int& s
       for(int i=0;i<size;i++)
         {
           PyObject *o=PyList_GetItem(value,i);
-          if(PyInt_Check(o))
-            stdvecTyypp[i]=(int)PyInt_AS_LONG(o);
+          if(PyLong_Check(o))
+            stdvecTyypp[i]=(int)PyLong_AS_LONG(o);
           else
             {
               std::ostringstream oss; oss << "List as been detected but element #" << i << " is not integer ! only lists of integers accepted !";
@@ -2646,7 +2644,7 @@ static PyObject *NewMethWrapCallInitOnlyIfDictWithSingleEltInInput(PyObject *cls
       PyObject *initMeth(PyObject_GetAttrString(instance,"__init__"));
       PyObject *zeNumpyRepr(0);
       {
-        PyObject *tmp1(PyInt_FromLong(0));
+        PyObject *tmp1(PyLong_FromLong(0));
        zeNumpyRepr=PyDict_GetItem(PyTuple_GetItem(args,1),tmp1);//borrowed
         Py_DECREF(tmp1);
       }
index 426faae0e98d8088cddaa4e3beb036da95730837..6cd4fa15d25e78c4ca7db377d4b01df73cf8b11c 100644 (file)
@@ -84,7 +84,7 @@ namespace MEDCoupling
           PyTuple_SetItem(res,1,SWIG_NewPointerObj((void*)ret1,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
         else
           {
-            PyObject *res1=PySlice_New(PyInt_FromLong(bb),PyInt_FromLong(ee),PyInt_FromLong(ss));
+            PyObject *res1=PySlice_New(PyLong_FromLong(bb),PyLong_FromLong(ee),PyLong_FromLong(ss));
             PyTuple_SetItem(res,1,res1);
           }
         return res;
@@ -327,7 +327,7 @@ namespace MEDCoupling
         for(std::size_t i=0;i<sz;i++)
           {
             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-            PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
+            PyList_SetItem(pyRet1,i,PyLong_FromLong(ret1[i]));
           }
         PyTuple_SetItem(pyRet,0,pyRet0);
         PyTuple_SetItem(pyRet,1,pyRet1);
@@ -384,7 +384,7 @@ namespace MEDCoupling
         DataArrayDouble *ret0=self->computeVectorOfCoefficients(mesh,arr,ret1);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
         return ret;
       }
       
@@ -394,8 +394,8 @@ namespace MEDCoupling
         DataArrayDouble *ret0=self->computeInverseMatrix(mesh,ret1,ret2);
         PyObject *ret=PyTuple_New(3);
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
-        PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
+        PyTuple_SetItem(ret,2,PyLong_FromLong(ret2));
         return ret;
       }
 
@@ -405,8 +405,8 @@ namespace MEDCoupling
         DataArrayDouble *ret0=self->computeMatrix(mesh,ret1,ret2);
         PyObject *ret=PyTuple_New(3);
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
-        PyTuple_SetItem(ret,2,PyInt_FromLong(ret2));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
+        PyTuple_SetItem(ret,2,PyLong_FromLong(ret2));
         return ret;
       }
       
@@ -423,7 +423,7 @@ namespace MEDCoupling
         DataArrayDouble *ret0=self->computeEvaluationMatrixOnGivenPts(mesh,inp,nbPts,ret1);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(ret0),SWIGTYPE_p_MEDCoupling__DataArrayDouble, SWIG_POINTER_OWN | 0 ));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(ret1));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(ret1));
         return ret;
       }
 
@@ -440,7 +440,7 @@ namespace MEDCoupling
         DataArrayDouble *ret0(self->performDrift(matr,arr,ret1));
         PyObject *res(PyTuple_New(2));
         PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
-        PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
+        PyTuple_SetItem(res,1,PyLong_FromLong(ret1));
         return res;
       }
 
@@ -450,7 +450,7 @@ namespace MEDCoupling
         DataArrayDouble *ret0(MEDCouplingFieldDiscretizationKriging::PerformDriftRect(matr,arr,ret1));
         PyObject *res(PyTuple_New(2));
         PyTuple_SetItem(res,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayDouble,SWIG_POINTER_OWN | 0));
-        PyTuple_SetItem(res,1,PyInt_FromLong(ret1));
+        PyTuple_SetItem(res,1,PyLong_FromLong(ret1));
         return res;
       }
 
index 397712f5d8666b668385c02c562585be7fbccc94..ea43e06c568b6f7f8f1924fe6b7a7d1211de07f0 100644 (file)
@@ -317,7 +317,7 @@ namespace MEDCoupling
       {
         int a,b,c;
         self->getSlice(a,b,c);
-        return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
+        return PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(c));
       }
       
       std::string __str__() const throw(INTERP_KERNEL::Exception)
@@ -549,11 +549,10 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArray::GetSlice (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
+        GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetSlice (wrap) : the input slice is invalid !");
         int a,b;
         DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
-        return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
+        return PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(step));
       }
 
       PyObject *getSlice(PyObject *slic, int sliceId, int nbOfSlices) const throw(INTERP_KERNEL::Exception)
@@ -561,11 +560,10 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArray::getSlice (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
+        GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getSlice (wrap) : the input slice is invalid !");
         int a,b;
         DataArray::GetSlice(strt,stp,step,sliceId,nbOfSlices,a,b);
-        return PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(step));
+        return PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(step));
       }
 
       static int GetNumberOfItemGivenBES(PyObject *slic) throw(INTERP_KERNEL::Exception)
@@ -573,8 +571,7 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
+        GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBES (wrap) : the input slice is invalid !");
         return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
       }
 
@@ -583,8 +580,7 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArray::GetNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
+        GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArray::GetNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
         return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
       }
       
@@ -600,8 +596,7 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBES (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
+        GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBES (wrap) : the input slice is invalid !");
         return DataArray::GetNumberOfItemGivenBES(strt,stp,step,"");
       }
 
@@ -610,8 +605,7 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArray::getNumberOfItemGivenBESRelative (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSlice(sly,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
+        GetIndicesOfSlice(slic,self->getNumberOfTuples(),&strt,&stp,&step,"DataArray::getNumberOfItemGivenBESRelative (wrap) : the input slice is invalid !");
         return DataArray::GetNumberOfItemGivenBESRelative(strt,stp,step,"");
       }
 
@@ -789,16 +783,16 @@ namespace MEDCoupling
           {
             if(nbOfTuples)
               {
-                if(PyInt_Check(nbOfTuples))
+                if(PyLong_Check(nbOfTuples))
                   {
-                    int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
                     if(elt2)
                       {
-                        if(PyInt_Check(elt2))
+                        if(PyLong_Check(elt2))
                           {//DataArrayDouble.New([1.,3.,4.,5.],2,2)
-                            int nbOfCompo=PyInt_AS_LONG(elt2);
+                            int nbOfCompo=PyLong_AS_LONG(elt2);
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
                             MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
@@ -830,18 +824,18 @@ namespace MEDCoupling
                 return ret.retn();
               }
           }
-        else if(PyInt_Check(elt0))
+        else if(PyLong_Check(elt0))
           {
-            int nbOfTuples1=PyInt_AS_LONG(elt0);
+            int nbOfTuples1=PyLong_AS_LONG(elt0);
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
               {
                 if(!elt2)
                   {
-                    if(PyInt_Check(nbOfTuples))
+                    if(PyLong_Check(nbOfTuples))
                       {//DataArrayDouble.New(5,2)
-                        int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("DataArrayDouble::New : should be a positive number of components !");
                         MCAuto<DataArrayDouble> ret=DataArrayDouble::New();
@@ -934,16 +928,16 @@ namespace MEDCoupling
           {
             if(nbOfTuples)
               {
-                if(PyInt_Check(nbOfTuples))
+                if(PyLong_Check(nbOfTuples))
                   {
-                    int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
-                        if(PyInt_Check(nbOfComp))
+                        if(PyLong_Check(nbOfComp))
                           {//DataArrayDouble.setValues([1.,3.,4.,5.],2,2)
-                            int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            int nbOfCompo=PyLong_AS_LONG(nbOfComp);
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayDouble::setValues : should be a positive number of components !");
                             std::vector<double> tmp=fillArrayWithPyListDbl2(li,nbOfTuples1,nbOfCompo);
@@ -1140,8 +1134,8 @@ namespace MEDCoupling
         double r0=self->minimalDistanceTo(other,thisTupleId,otherTupleId);
         PyObject *ret=PyTuple_New(3);
         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r0));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(thisTupleId));
-        PyTuple_SetItem(ret,2,PyInt_FromLong(otherTupleId));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(thisTupleId));
+        PyTuple_SetItem(ret,2,PyLong_FromLong(otherTupleId));
         return ret;
       }
 
@@ -1151,7 +1145,7 @@ namespace MEDCoupling
         double r1=self->getMaxValue(tmp);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -1171,7 +1165,7 @@ namespace MEDCoupling
         double r1=self->getMinValue(tmp);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,PyFloat_FromDouble(r1));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -1233,7 +1227,7 @@ namespace MEDCoupling
         double ret0=self->distanceToTuple(pt,pt+nbOfCompo,tupleId);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,PyFloat_FromDouble(ret0));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tupleId));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tupleId));
         return ret;
       }
 
@@ -2426,7 +2420,7 @@ namespace MEDCoupling
         PyObject *ret0(PyDict_New());
         PyObject *numpyArryObj(MEDCoupling_DataArrayDouble_toNumPyArray(self));
         {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
-          PyObject *tmp1(PyInt_FromLong(0));
+          PyObject *tmp1(PyLong_FromLong(0));
           PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
           PyTuple_SetItem(ret,0,ret0);
         }
@@ -2517,7 +2511,7 @@ namespace MEDCoupling
 
       PyObject *__len__() throw(INTERP_KERNEL::Exception)
       {
-        return PyInt_FromLong(self->getNumberOfCompo());
+        return PyLong_FromLong(self->getNumberOfCompo());
       }
 
       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
@@ -2892,16 +2886,16 @@ namespace MEDCoupling
           {
             if(nbOfTuples)
               {
-                if(PyInt_Check(nbOfTuples))
+                if(PyLong_Check(nbOfTuples))
                   {
-                    int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
-                        if(PyInt_Check(nbOfComp))
+                        if(PyLong_Check(nbOfComp))
                           {//DataArrayInt.New([1,3,4,5],2,2)
-                            int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            int nbOfCompo=PyLong_AS_LONG(nbOfComp);
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
                             MCAuto<DataArrayInt> ret=DataArrayInt::New();
@@ -2933,18 +2927,18 @@ namespace MEDCoupling
                 return ret.retn();
               }
           }
-        else if(PyInt_Check(elt0))
+        else if(PyLong_Check(elt0))
           {
-            int nbOfTuples1=PyInt_AS_LONG(elt0);
+            int nbOfTuples1=PyLong_AS_LONG(elt0);
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
               {
                 if(!nbOfComp)
                   {
-                    if(PyInt_Check(nbOfTuples))
+                    if(PyLong_Check(nbOfTuples))
                       {//DataArrayInt.New(5,2)
-                        int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("DataArrayInt::New : should be a positive number of components !");
                         MCAuto<DataArrayInt> ret=DataArrayInt::New();
@@ -3042,7 +3036,7 @@ namespace MEDCoupling
         std::vector< std::pair<int,int> > slcs(self->splitInBalancedSlices(nbOfSlices));
         PyObject *ret=PyList_New(slcs.size());
         for(std::size_t i=0;i<slcs.size();i++)
-          PyList_SetItem(ret,i,PySlice_New(PyInt_FromLong(slcs[i].first),PyInt_FromLong(slcs[i].second),PyInt_FromLong(1)));
+          PyList_SetItem(ret,i,PySlice_New(PyLong_FromLong(slcs[i].first),PyLong_FromLong(slcs[i].second),PyLong_FromLong(1)));
         return ret;
       }
 
@@ -3051,8 +3045,7 @@ namespace MEDCoupling
         if(!PySlice_Check(slic))
           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : expecting a pyslice as second (first) parameter !");
         Py_ssize_t strt=2,stp=2,step=2;
-        PySliceObject *sly=reinterpret_cast<PySliceObject *>(slic);
-        GetIndicesOfSliceExplicitely(sly,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
+        GetIndicesOfSliceExplicitely(slic,&strt,&stp,&step,"DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice is invalid !");
         if(strt==std::numeric_limits<int>::max() || stp==std::numeric_limits<int>::max())
           throw INTERP_KERNEL::Exception("DataArrayInt::buildExplicitArrOfSliceOnScaledArr (wrap) : the input slice contains some unknowns that can't be determined in static method ! Call DataArray::getSlice (non static) instead !");
         return self->buildExplicitArrOfSliceOnScaledArr(strt,stp,step);
@@ -3063,8 +3056,8 @@ namespace MEDCoupling
         int a,b;
         self->getMinMaxValues(a,b);
         PyObject *ret=PyTuple_New(2);
-        PyTuple_SetItem(ret,0,PyInt_FromLong(a));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(b));
+        PyTuple_SetItem(ret,0,PyLong_FromLong(a));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(b));
         return ret;
       }
    
@@ -3078,7 +3071,7 @@ namespace MEDCoupling
         DataArrayInt *ret0=MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(nbOfOldTuples,arrPtr,arrIPtr,arrIPtr+szArrI,newNbOfTuples);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,SWIG_NewPointerObj((void*)ret0,SWIGTYPE_p_MEDCoupling__DataArrayInt,SWIG_POINTER_OWN | 0));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(newNbOfTuples));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(newNbOfTuples));
         return ret;
       }
 
@@ -3100,16 +3093,16 @@ namespace MEDCoupling
           {
             if(nbOfTuples && nbOfTuples != Py_None)
               {
-                if(PyInt_Check(nbOfTuples))
+                if(PyLong_Check(nbOfTuples))
                   {
-                    int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
                     if(nbOfTuples<0)
                       throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive set of allocated memory !");
                     if(nbOfComp && nbOfComp != Py_None)
                       {
-                        if(PyInt_Check(nbOfComp))
+                        if(PyLong_Check(nbOfComp))
                           {//DataArrayInt.setValues([1,3,4,5],2,2)
-                            int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            int nbOfCompo=PyLong_AS_LONG(nbOfComp);
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayInt::setValue : should be a positive number of components !");
                             std::vector<int> tmp=fillArrayWithPyListInt2(li,nbOfTuples1,nbOfCompo);
@@ -3453,8 +3446,8 @@ namespace MEDCoupling
         int tmp;
         int r1=self->getMaxValue(tmp);
         PyObject *ret=PyTuple_New(2);
-        PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -3463,8 +3456,8 @@ namespace MEDCoupling
         int tmp;
         int r1=self->getMinValue(tmp);
         PyObject *ret=PyTuple_New(2);
-        PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -3475,9 +3468,9 @@ namespace MEDCoupling
           {
           case 1:
             {
-              if(PyInt_Check(obj))
+              if(PyLong_Check(obj))
                 {
-                  int val=(int)PyInt_AS_LONG(obj);
+                  int val=(int)PyLong_AS_LONG(obj);
                   return self->findIdFirstEqual(val);
                 }
               else
@@ -3501,9 +3494,9 @@ namespace MEDCoupling
             return false;
           case 1:
             {
-              if(PyInt_Check(obj))
+              if(PyLong_Check(obj))
                 {
-                  int val=(int)PyInt_AS_LONG(obj);
+                  int val=(int)PyLong_AS_LONG(obj);
                   return self->presenceOfValue(val);
                 }
               else
@@ -3537,7 +3530,7 @@ namespace MEDCoupling
           case 1:
             {
               if(nbOfComponents==1)
-                return PyInt_FromLong(self->getIJSafe(it1,0));
+                return PyLong_FromLong(self->getIJSafe(it1,0));
               return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(&it1,&it1+1)),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
             }
           case 2:
@@ -3547,7 +3540,7 @@ namespace MEDCoupling
           case 4:
             return SWIG_NewPointerObj(SWIG_as_voidptr(self->selectByTupleIdSafe(dt1->getConstPointer(),dt1->getConstPointer()+dt1->getNbOfElems())),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 );
           case 5:
-            return PyInt_FromLong(self->getIJSafe(it1,ic1));
+            return PyLong_FromLong(self->getIJSafe(it1,ic1));
           case 6:
             {
               ret=self->selectByTupleIdSafe(&vt1[0],&vt1[0]+vt1.size());
@@ -4722,7 +4715,7 @@ namespace MEDCoupling
         for(std::size_t i=0;i<sz;i++)
           {
             PyList_SetItem(pyRet0,i,SWIG_NewPointerObj(SWIG_as_voidptr(ret0[i]),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 ));
-            PyList_SetItem(pyRet1,i,PyInt_FromLong(ret1[i]));
+            PyList_SetItem(pyRet1,i,PyLong_FromLong(ret1[i]));
           }
         PyTuple_SetItem(pyRet,0,pyRet0);
         PyTuple_SetItem(pyRet,1,pyRet1);
@@ -4748,7 +4741,7 @@ namespace MEDCoupling
         Py_XINCREF(ret0Py);
         PyTuple_SetItem(pyRet,0,ret0Py);
         if(ret)
-          ret1Py=PySlice_New(PyInt_FromLong(a),PyInt_FromLong(b),PyInt_FromLong(c));
+          ret1Py=PySlice_New(PyLong_FromLong(a),PyLong_FromLong(b),PyLong_FromLong(c));
         else
           {
             ret1Py=Py_None;
@@ -4773,7 +4766,7 @@ namespace MEDCoupling
         PyObject *ret0(PyDict_New());
         PyObject *numpyArryObj(MEDCoupling_DataArrayInt_toNumPyArray(self));
         {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
-          PyObject *tmp1(PyInt_FromLong(0));
+          PyObject *tmp1(PyLong_FromLong(0));
           PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
           PyTuple_SetItem(ret,0,ret0);
         }
@@ -4872,7 +4865,7 @@ namespace MEDCoupling
 
       PyObject *__len__() throw(INTERP_KERNEL::Exception)
       {
-        return PyInt_FromLong(self->getNumberOfCompo());
+        return PyLong_FromLong(self->getNumberOfCompo());
       }
   
       PyObject *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
@@ -4898,11 +4891,11 @@ namespace MEDCoupling
                   return 0;
                 }
               if(singleVal>=0)
-                return PyInt_FromLong(pt[singleVal]);
+                return PyLong_FromLong(pt[singleVal]);
               else
                 {
                   if(nbc+singleVal>0)
-                    return PyInt_FromLong(pt[nbc+singleVal]);
+                    return PyLong_FromLong(pt[nbc+singleVal]);
                   else
                     {
                       std::ostringstream oss;
@@ -4923,7 +4916,7 @@ namespace MEDCoupling
                       oss << "Requesting for id #" << cid << " having only " << nbc << " components !";
                       throw INTERP_KERNEL::Exception(oss.str().c_str());
                     }
-                  PyTuple_SetItem(t,j,PyInt_FromLong(pt[cid]));
+                  PyTuple_SetItem(t,j,PyLong_FromLong(pt[cid]));
                 }
               return t;
             }
@@ -4932,7 +4925,7 @@ namespace MEDCoupling
               int sz=DataArray::GetNumberOfItemGivenBES(slic.first,slic.second.first,slic.second.second,msg2);
               PyObject *t=PyTuple_New(sz);
               for(int j=0;j<sz;j++)
-                PyTuple_SetItem(t,j,PyInt_FromLong(pt[slic.first+j*slic.second.second]));
+                PyTuple_SetItem(t,j,PyLong_FromLong(pt[slic.first+j*slic.second.second]));
               return t;
             }
           default:
@@ -5293,16 +5286,16 @@ namespace MEDCoupling
           {
             if(nbOfTuples)
               {
-                if(PyInt_Check(nbOfTuples))
+                if(PyLong_Check(nbOfTuples))
                   {
-                    int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
-                        if(PyInt_Check(nbOfComp))
+                        if(PyLong_Check(nbOfComp))
                           {//DataArrayByte.New([1,3,4,5],2,2)
-                            int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            int nbOfCompo=PyLong_AS_LONG(nbOfComp);
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
                             MCAuto<DataArrayByte> ret=DataArrayByte::New();
@@ -5334,18 +5327,18 @@ namespace MEDCoupling
                 return ret.retn();
               }
           }
-        else if(PyInt_Check(elt0))
+        else if(PyLong_Check(elt0))
           {
-            int nbOfTuples1=PyInt_AS_LONG(elt0);
+            int nbOfTuples1=PyLong_AS_LONG(elt0);
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
               {
                 if(!nbOfComp)
                   {
-                    if(PyInt_Check(nbOfTuples))
+                    if(PyLong_Check(nbOfTuples))
                       {//DataArrayByte.New(5,2)
-                        int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("DataArrayByte::New : should be a positive number of components !");
                         MCAuto<DataArrayByte> ret=DataArrayByte::New();
@@ -5476,7 +5469,7 @@ namespace MEDCoupling
         INTERP_KERNEL::AutoPtr<char> tmp=new char[sz];
         self->getTuple(tupleId,tmp);
         PyObject *ret=PyTuple_New(sz);
-        for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyInt_FromLong((int)tmp[i]));
+        for(int i=0;i<sz;i++) PyTuple_SetItem(ret,i,PyLong_FromLong((int)tmp[i]));
         return ret;
       }
 
@@ -5485,8 +5478,8 @@ namespace MEDCoupling
         int tmp;
         int r1=(int)self->getMaxValue(tmp);
         PyObject *ret=PyTuple_New(2);
-        PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -5495,8 +5488,8 @@ namespace MEDCoupling
         int tmp;
         int r1=(int)self->getMinValue(tmp);
         PyObject *ret=PyTuple_New(2);
-        PyTuple_SetItem(ret,0,PyInt_FromLong(r1));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,0,PyLong_FromLong(r1));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -5507,9 +5500,9 @@ namespace MEDCoupling
           {
           case 1:
             {
-              if(PyInt_Check(obj))
+              if(PyLong_Check(obj))
                 {
-                  int val=(int)PyInt_AS_LONG(obj);
+                  int val=(int)PyLong_AS_LONG(obj);
                   return self->findIdFirstEqual(val);
                 }
               else
@@ -5529,9 +5522,9 @@ namespace MEDCoupling
             return false;
           case 1:
             {
-              if(PyInt_Check(obj))
+              if(PyLong_Check(obj))
                 {
-                  int val=(int)PyInt_AS_LONG(obj);
+                  int val=(int)PyLong_AS_LONG(obj);
                   return self->presenceOfValue(val);
                 }
               else
@@ -5564,7 +5557,7 @@ namespace MEDCoupling
         PyObject *ret0(PyDict_New());
         PyObject *numpyArryObj(MEDCoupling_DataArrayByte_toNumPyArray(self));
         {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
-          PyObject *tmp1(PyInt_FromLong(0));
+          PyObject *tmp1(PyLong_FromLong(0));
           PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
           PyTuple_SetItem(ret,0,ret0);
         }
@@ -5849,16 +5842,16 @@ namespace MEDCoupling
           {
             if(nbOfTuples)
               {
-                if(PyInt_Check(nbOfTuples))
+                if(PyLong_Check(nbOfTuples))
                   {
-                    int nbOfTuples1=PyInt_AS_LONG(nbOfTuples);
+                    int nbOfTuples1=PyLong_AS_LONG(nbOfTuples);
                     if(nbOfTuples1<0)
                       throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
                     if(nbOfComp)
                       {
-                        if(PyInt_Check(nbOfComp))
+                        if(PyLong_Check(nbOfComp))
                           {//DataArrayAsciiChar.New([1,3,4,5],2,2)
-                            int nbOfCompo=PyInt_AS_LONG(nbOfComp);
+                            int nbOfCompo=PyLong_AS_LONG(nbOfComp);
                             if(nbOfCompo<0)
                               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
                             MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
@@ -5909,18 +5902,18 @@ namespace MEDCoupling
                   }
               }
           }
-        else if(PyInt_Check(elt0))
+        else if(PyLong_Check(elt0))
           {
-            int nbOfTuples1=PyInt_AS_LONG(elt0);
+            int nbOfTuples1=PyLong_AS_LONG(elt0);
             if(nbOfTuples1<0)
               throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive set of allocated memory !");
             if(nbOfTuples)
               {
                 if(!nbOfComp)
                   {
-                    if(PyInt_Check(nbOfTuples))
+                    if(PyLong_Check(nbOfTuples))
                       {//DataArrayAsciiChar.New(5,2)
-                        int nbOfCompo=PyInt_AS_LONG(nbOfTuples);
+                        int nbOfCompo=PyLong_AS_LONG(nbOfTuples);
                         if(nbOfCompo<0)
                           throw INTERP_KERNEL::Exception("DataArrayAsciiChar::New : should be a positive number of components !");
                         MCAuto<DataArrayAsciiChar> ret=DataArrayAsciiChar::New();
@@ -6068,7 +6061,7 @@ namespace MEDCoupling
         tmp2[0]=self->getMaxValue(tmp);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
@@ -6079,7 +6072,7 @@ namespace MEDCoupling
         tmp2[0]=self->getMinValue(tmp);
         PyObject *ret=PyTuple_New(2);
         PyTuple_SetItem(ret,0,PyString_FromString(tmp2));
-        PyTuple_SetItem(ret,1,PyInt_FromLong(tmp));
+        PyTuple_SetItem(ret,1,PyLong_FromLong(tmp));
         return ret;
       }
 
index d170e14690e6b1dc3e4145c2ca276fb03bea52fc..d926d236984c58cb963321eb0973b3ab528ef12c 100644 (file)
@@ -87,7 +87,7 @@ namespace MEDCoupling
                  const std::map<int,double>& row=m[i];
                  PyObject *ret0=PyDict_New();
                  for(std::map<int,double>::const_iterator it=row.begin();it!=row.end();it++)
-                   PyDict_SetItem(ret0,PyInt_FromLong((*it).first),PyFloat_FromDouble((*it).second));
+                   PyDict_SetItem(ret0,PyLong_FromLong((*it).first),PyFloat_FromDouble((*it).second));
                  PyList_SetItem(ret,i,ret0);
                }
              return ret;
index 14d39353a3645a2dbbf5af115cdfc17cd398ae1e..e31d716d8fa7479935f190ba44d76477ab450baa 100644 (file)
@@ -24,7 +24,7 @@ INCLUDE(${SWIG_USE_FILE})
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_FLAGS "-py3")
 SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
 
 SET (MEDLoader_SWIG_DPYS_FILES
index c205a3e7832ba82a0844c2538553f369afd22bce..2e5b1a9aa81bac499ce1d962b5840e24b7cd4710 100644 (file)
@@ -541,7 +541,7 @@ namespace MEDCoupling
       int size=v.size();
       PyObject *ret=PyList_New(size);
       for(int i=0;i<size;i++)
-        PyList_SetItem(ret,i,PyInt_FromLong((int)v[i]));
+        PyList_SetItem(ret,i,PyLong_FromLong((int)v[i]));
       return ret;
     }
   
@@ -603,7 +603,7 @@ namespace MEDCoupling
            DataArrayByte *retCpp(MEDCoupling_MEDFileWritableStandAlone_serialize(self));
            PyObject *numpyArryObj=SWIG_NewPointerObj(SWIG_as_voidptr(retCpp),SWIGTYPE_p_MEDCoupling__DataArrayByte, SWIG_POINTER_OWN | 0 );
            {// create a dict to discriminite in __new__ if __init__ should be called. Not beautiful but not idea ...
-             PyObject *tmp1(PyInt_FromLong(0));
+             PyObject *tmp1(PyLong_FromLong(0));
              PyDict_SetItem(ret0,tmp1,numpyArryObj); Py_DECREF(tmp1); Py_DECREF(numpyArryObj);
              PyTuple_SetItem(ret,0,ret0);
            }
@@ -812,9 +812,9 @@ namespace MEDCoupling
 
       MEDFileJoint *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
       {
-        if(PyInt_Check(obj))
+        if(PyLong_Check(obj))
           {
-            MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfJoints()));
+            MEDFileJoint *ret=self->getJointAtPos(InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfJoints()));
             if(ret)
               ret->incrRef();
             return ret;
@@ -906,7 +906,7 @@ namespace MEDCoupling
         std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
         PyObject *res=PyList_New(result.size());
         for(int i=0;iL!=result.end(); i++, iL++)
-          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+          PyList_SetItem(res,i,PyLong_FromLong(*iL));
         return res;
       }
     }
@@ -1195,7 +1195,7 @@ namespace MEDCoupling
            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
            PyObject *res=PyList_New(result.size());
            for(int i=0;iL!=result.end(); i++, iL++)
-             PyList_SetItem(res,i,PyInt_FromLong(*iL));
+             PyList_SetItem(res,i,PyLong_FromLong(*iL));
            return res;
          }
 
@@ -1205,7 +1205,7 @@ namespace MEDCoupling
            std::vector<INTERP_KERNEL::NormalizedCellType>::const_iterator iL=result.begin();
            PyObject *res=PyList_New(result.size());
            for(int i=0;iL!=result.end(); i++, iL++)
-             PyList_SetItem(res,i,PyInt_FromLong(*iL));
+             PyList_SetItem(res,i,PyLong_FromLong(*iL));
            return res;
          }
 
@@ -1823,9 +1823,9 @@ namespace MEDCoupling
 
          MEDFileMesh *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
          {
-           if(PyInt_Check(obj))
+           if(PyLong_Check(obj))
              {
-               MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfMeshes()));
+               MEDFileMesh *ret=self->getMeshAtPos(InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfMeshes()));
                if(ret)
                  ret->incrRef();
                return ret;
@@ -2481,9 +2481,9 @@ namespace MEDCoupling
 
       int getTimeId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
       {
-        if(elt0 && PyInt_Check(elt0))
+        if(elt0 && PyLong_Check(elt0))
           {//fmts[3]
-            int pos=PyInt_AS_LONG(elt0);
+            int pos=PyLong_AS_LONG(elt0);
             return pos;
           }
         else if(elt0 && PyTuple_Check(elt0))
@@ -2492,10 +2492,10 @@ namespace MEDCoupling
               {
                 PyObject *o0=PyTuple_GetItem(elt0,0);
                 PyObject *o1=PyTuple_GetItem(elt0,1);
-                if(PyInt_Check(o0) && PyInt_Check(o1))
+                if(PyLong_Check(o0) && PyLong_Check(o1))
                   {//fmts(1,-1)
-                    int iter=PyInt_AS_LONG(o0);
-                    int order=PyInt_AS_LONG(o1);
+                    int iter=PyLong_AS_LONG(o0);
+                    int order=PyLong_AS_LONG(o1);
                     return self->getPosOfTimeStep(iter,order);
                   }
                 else
@@ -2622,8 +2622,7 @@ namespace MEDCoupling
         if(PySlice_Check(elts))
           {
             Py_ssize_t strt=2,stp=2,step=2;
-            PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
-            GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
+            GetIndicesOfSlice(elts,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__delitem__ : error in input slice !");
             self->eraseTimeStepIds2(strt,stp,step);
           }
         else
@@ -2688,8 +2687,7 @@ namespace MEDCoupling
         else if(elt0 && PySlice_Check(elt0))
           {
             Py_ssize_t strt=2,stp=2,step=2;
-            PySliceObject *oC=reinterpret_cast<PySliceObject *>(elt0);
-            GetIndicesOfSlice(oC,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
+            GetIndicesOfSlice(elt0,self->getNumberOfTS(),&strt,&stp,&step,"MEDFileAnyTypeFieldMultiTS.__getitem__ : error in input slice !");
             return convertMEDFileFieldMultiTS(self->buildSubPartSlice(strt,stp,step),SWIG_POINTER_OWN | 0);
           }
         else
@@ -3257,9 +3255,9 @@ namespace MEDCoupling
 
          int getPosOfField(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
          {
-           if(elt0 && PyInt_Check(elt0))
+           if(elt0 && PyLong_Check(elt0))
              {//fmts[3]
-               return PyInt_AS_LONG(elt0);
+               return PyLong_AS_LONG(elt0);
              }
            else if(elt0 && PyString_Check(elt0))
              return self->getPosFromFieldName(PyString_AsString(elt0));
@@ -3300,8 +3298,7 @@ namespace MEDCoupling
            if(elts && PySlice_Check(elts))
              {
                Py_ssize_t strt=2,stp=2,step=2;
-               PySliceObject *oC=reinterpret_cast<PySliceObject *>(elts);
-               GetIndicesOfSlice(oC,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
+               GetIndicesOfSlice(elts,self->getNumberOfFields(),&strt,&stp,&step,"MEDFileFields.__delitem__ : error in input slice !");
                self->destroyFieldsAtPos2(strt,stp,step);
              }
            else
@@ -3495,9 +3492,9 @@ namespace MEDCoupling
 
       int getTimeStepId(PyObject *elt0) const throw(INTERP_KERNEL::Exception)
       {
-        if(elt0 && PyInt_Check(elt0))
+        if(elt0 && PyLong_Check(elt0))
           {//fmts[3]
-            int pos=InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
+            int pos=InterpreteNegativeInt(PyLong_AS_LONG(elt0),self->getNumberOfTS());
             return pos;
           }
         else if(elt0 && PyTuple_Check(elt0))
@@ -3506,10 +3503,10 @@ namespace MEDCoupling
               {
                 PyObject *o0=PyTuple_GetItem(elt0,0);
                 PyObject *o1=PyTuple_GetItem(elt0,1);
-                if(PyInt_Check(o0) && PyInt_Check(o1))
+                if(PyLong_Check(o0) && PyLong_Check(o1))
                   {//fmts(1,-1)
-                    int iter=PyInt_AS_LONG(o0);
-                    int order=PyInt_AS_LONG(o1);
+                    int iter=PyLong_AS_LONG(o0);
+                    int order=PyLong_AS_LONG(o1);
                     return self->getPosOfTimeStep(iter,order);
                   }
                 else
@@ -3650,9 +3647,9 @@ namespace MEDCoupling
 
       MEDFileParameterMultiTS *__getitem__(PyObject *obj) throw(INTERP_KERNEL::Exception)
       {
-        if(PyInt_Check(obj))
+        if(PyLong_Check(obj))
           {
-            MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfParams()));
+            MEDFileParameterMultiTS *ret=self->getParamAtPos(InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfParams()));
             if(ret)
               ret->incrRef();
             return ret;
@@ -3909,7 +3906,7 @@ namespace MEDCoupling
         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
         PyObject *res(PyList_New(result.size()));
         for(int i=0;iL!=result.end(); i++, iL++)
-          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+          PyList_SetItem(res,i,PyLong_FromLong(*iL));
         return res;
       }
     }
@@ -4018,7 +4015,7 @@ namespace MEDCoupling
         std::vector< INTERP_KERNEL::NormalizedCellType >::const_iterator iL(result.begin());
         PyObject *res(PyList_New(result.size()));
         for(int i=0;iL!=result.end(); i++, iL++)
-          PyList_SetItem(res,i,PyInt_FromLong(*iL));
+          PyList_SetItem(res,i,PyLong_FromLong(*iL));
         return res;
       }
     }
index 0cf84bc094fdc263e1cbfc8ff88fa3d3c1efdd23..9870a8d6f1c92400901597ec88aed103fb13ba16 100644 (file)
@@ -126,13 +126,13 @@ static std::vector<std::pair<int,int> > convertTimePairIdsFromPy(PyObject *pyLi)
               if(size2!=2)
                 throw INTERP_KERNEL::Exception("tuples in list must be of size 2 (dt,it) !");
               PyObject *o0=PyTuple_GetItem(o,0);
-              if(PyInt_Check(o0))
-                p.first=(int)PyInt_AS_LONG(o0);
+              if(PyLong_Check(o0))
+                p.first=(int)PyLong_AS_LONG(o0);
               else
                 throw INTERP_KERNEL::Exception("First elem of tuples in list must be integer : dt !");
               PyObject *o1=PyTuple_GetItem(o,1);
-              if(PyInt_Check(o1))
-                p.second=(int)PyInt_AS_LONG(o1);
+              if(PyLong_Check(o1))
+                p.second=(int)PyLong_AS_LONG(o1);
               else
                 throw INTERP_KERNEL::Exception("Second elem of tuples in list must be integer : dt !");
               ret[i]=p;
@@ -336,9 +336,9 @@ std::vector< std::pair<std::vector<std::string>, std::string > > convertVecPairV
  */
 int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS *self, PyObject *elt0) throw(INTERP_KERNEL::Exception)
 {
-  if(elt0 && PyInt_Check(elt0))
+  if(elt0 && PyLong_Check(elt0))
     {//fmts[3]
-      return InterpreteNegativeInt(PyInt_AS_LONG(elt0),self->getNumberOfTS());
+      return InterpreteNegativeInt(PyLong_AS_LONG(elt0),self->getNumberOfTS());
     }
   else if(elt0 && PyTuple_Check(elt0))
     {
@@ -346,10 +346,10 @@ int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS
         {
           PyObject *o0=PyTuple_GetItem(elt0,0);
           PyObject *o1=PyTuple_GetItem(elt0,1);
-          if(PyInt_Check(o0) && PyInt_Check(o1))
+          if(PyLong_Check(o0) && PyLong_Check(o1))
             {//fmts(1,-1)
-              int iter=PyInt_AS_LONG(o0);
-              int order=PyInt_AS_LONG(o1);
+              int iter=PyLong_AS_LONG(o0);
+              int order=PyLong_AS_LONG(o1);
               return self->getPosOfTimeStep(iter,order);
             }
           else
@@ -373,9 +373,9 @@ int MEDFileAnyTypeFieldMultiTSgetitemSingleTS__(const MEDFileAnyTypeFieldMultiTS
  */
 int MEDFileFieldsgetitemSingleTS__(const MEDFileFields *self, PyObject *obj) throw(INTERP_KERNEL::Exception)
 {
-  if(PyInt_Check(obj))
+  if(PyLong_Check(obj))
     {
-      return InterpreteNegativeInt((int)PyInt_AS_LONG(obj),self->getNumberOfFields());
+      return InterpreteNegativeInt((int)PyLong_AS_LONG(obj),self->getNumberOfFields());
     }
   else if(PyString_Check(obj))
     {
@@ -394,9 +394,9 @@ void convertToMapIntDataArrayInt(PyObject *pyMap, std::map<int, MCAuto<DataArray
   cppMap.clear();
   while (PyDict_Next(pyMap,&pos,&key,&value))
     {
-      if(!PyInt_Check(key))
-        throw INTERP_KERNEL::Exception("convertToMapIntDataArrayInt : keys in map must be PyInt !");
-      long k(PyInt_AS_LONG(key));
+      if(!PyLong_Check(key))
+        throw INTERP_KERNEL::Exception("convertToMapIntDataArrayInt : keys in map must be PyLong !");
+      long k(PyLong_AS_LONG(key));
       void *argp(0);
       int status(SWIG_ConvertPtr(value,&argp,SWIGTYPE_p_MEDCoupling__DataArrayInt,0|0));
       if(!SWIG_IsOK(status))
index 0c622da76f9f8833ad41d9609e09e7990db72112..6cd47d58198fce15a66f970d41099b598b8f31d1 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(${SWIG_USE_FILE})
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDPartitioner.i PROPERTIES SWIG_FLAGS "-py3")
 SET(SWIG_MODULE_MEDPartitioner_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
 
 SET (MEDPartitioner_SWIG_DPYS_FILES
index 603a63ad3f6cc40086318f9268db5483c6cc7f2f..1e85b6fe2695e89a04113348fe00566ef6d73fe9 100644 (file)
@@ -23,7 +23,7 @@ FIND_PACKAGE(SWIG REQUIRED)
 INCLUDE(${SWIG_USE_FILE})
 
 SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_FLAGS "-py3")
 SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
 
 SET (ParaMEDMEM_SWIG_DPYS_FILES
@@ -56,7 +56,7 @@ SWIG_ADD_MODULE(ParaMEDMEM python ParaMEDMEM.i)
 SWIG_LINK_LIBRARIES(ParaMEDMEM ${PYTHON_LIBRARIES} paramedmem medloader)
 
 SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_FLAGS "-py3")
 
 INSTALL(TARGETS _ParaMEDMEM DESTINATION ${MEDCOUPLING_INSTALL_PYTHON})
 INSTALL(FILES ParaMEDMEM.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
index ad79ab7dca15d07dec43a827f6b64b840e1e0ed7..fa3d8356808eb79943aaea10188703d42e1b2ac9 100644 (file)
@@ -77,7 +77,7 @@ public:
     int size=self->getCellMesh()->getNumberOfCells();
     PyObject *ret=PyList_New(size);
     for(int i=0;i<size;i++)
-      PyList_SetItem(ret,i,PyInt_FromLong(tmp[i])); 
+      PyList_SetItem(ret,i,PyLong_FromLong(tmp[i])); 
     return ret;
   }
 
@@ -87,7 +87,7 @@ public:
     int size=self->getFaceMesh()->getNumberOfCells();
     PyObject *ret=PyList_New(size);
     for(int i=0;i<size;i++)
-      PyList_SetItem(ret,i,PyInt_FromLong(tmp[i])); 
+      PyList_SetItem(ret,i,PyLong_FromLong(tmp[i])); 
     return ret;
   }
 
@@ -97,7 +97,7 @@ public:
     int size=self->getCellMesh()->getNumberOfNodes();
     PyObject *ret=PyList_New(size);
     for(int i=0;i<size;i++)
-      PyList_SetItem(ret,i,PyInt_FromLong(tmp[i])); 
+      PyList_SetItem(ret,i,PyLong_FromLong(tmp[i])); 
     return ret;
   }
 }
@@ -118,7 +118,7 @@ enum mpi_constants { mpi_comm_world, mpi_comm_self, mpi_double, mpi_int };
 // Map mpi_comm_world and mpi_comm_self -> MPI_COMM_WORLD and MPI_COMM_SELF
 %typemap(in) MPI_Comm
 { 
-  switch (PyInt_AsLong($input))
+  switch (PyLong_AsLong($input))
     {
     case mpi_comm_world: $1 = MPI_COMM_WORLD; break;
     case mpi_comm_self:  $1 = MPI_COMM_SELF;  break;
@@ -130,7 +130,7 @@ enum mpi_constants { mpi_comm_world, mpi_comm_self, mpi_double, mpi_int };
 // Map mpi_double and mpi_int -> MPI_DOUBLE and MPI_INT
 %typemap(in) MPI_Datatype
 { 
-  switch (PyInt_AsLong($input))
+  switch (PyLong_AsLong($input))
     {
     case mpi_double:     $1 = MPI_DOUBLE;     break;
     case mpi_int:        $1 = MPI_INT;        break;
@@ -161,7 +161,7 @@ MPI_INT        = mpi_int
         PyErr_SetString(PyExc_RuntimeError,"Erorr in MPI_Comm_size()");
         return NULL;
       }
-    return PyInt_FromLong( res );
+    return PyLong_FromLong( res );
   } %}
 
 // ==============
@@ -176,7 +176,7 @@ MPI_INT        = mpi_int
         PyErr_SetString(PyExc_RuntimeError,"Erorr in MPI_Comm_rank()");
         return NULL;
       }
-    return PyInt_FromLong( res );
+    return PyLong_FromLong( res );
   } 
   %}
 
@@ -218,7 +218,7 @@ int MPI_Finalize();
       {
         aBuf = (void*) ( intBuf = new int[ nb ] );
         for ( int i = 0; i < aSize; ++i )
-          intBuf[i] = int( PyInt_AS_LONG( PyList_GetItem( buffer, i )));
+          intBuf[i] = int( PyLong_AS_LONG( PyList_GetItem( buffer, i )));
       }
     else
       {
@@ -245,7 +245,7 @@ int MPI_Finalize();
     else
       {
         for ( int i = 0; i < aSize && !pyerr; ++i )
-          pyerr = PyList_SetItem(buffer, i, PyInt_FromLong( intBuf[i] ));
+          pyerr = PyList_SetItem(buffer, i, PyLong_FromLong( intBuf[i] ));
         delete [] intBuf;
       }
     if ( pyerr )
@@ -253,7 +253,7 @@ int MPI_Finalize();
         PyErr_SetString(PyExc_RuntimeError, "Error of PyList_SetItem()");
         return NULL;
       }
-    return PyInt_FromLong( err );
+    return PyLong_FromLong( err );
 
   }
   %}
index 9971ed8b59dc74341880098318f59b455725a9aa..83fa1e4b1666f9e9a7a27ddcb545f4e6f78df4f0 100644 (file)
@@ -62,7 +62,7 @@
     for (int i=0; i < size; i++)
     {
       PyObject * tmp = PyList_GetItem($input,i);
-      TYPE elem = PyInt_AsLong(tmp);
+      TYPE elem = PyLong_AsLong(tmp);
       tmpSet.insert(elem);
     }
     $1 = tmpSet;
index 95e83e3df7685b51fd7f35a3d16a72a444a47335..d64358fe11b6105d9dea1ac709f8232a97d82a17 100644 (file)
@@ -22,7 +22,7 @@ INCLUDE(${SWIG_USE_FILE})
 ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_FLAGS "-py3")
 SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS};-DWITHOUT_AUTOFIELD")
 
 IF(Boost_FOUND)
index 6f8782e8ba3a9e60aa39e4e6069c61fc02923e92..0f121ece8abc14cf0cff38539f380a19785dfb9d 100644 (file)
@@ -102,6 +102,6 @@ namespace MED_RENUMBER
 import os
 __filename=os.environ.get('PYTHONSTARTUP')
 if __filename and os.path.isfile(__filename):
-  execfile(__filename)
+  exec(open(__filename).read())
   pass
 %}