Fix for bug #3057804: migrate PyCObject to PyCapsule.
Other misc. fixes for python3.2, mostly dealing with changed interfaces to python functions. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12620 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7a0726c8b6
commit
17af467132
5 changed files with 46 additions and 20 deletions
|
|
@ -13,6 +13,12 @@
|
|||
|
||||
%{
|
||||
#include <iostream>
|
||||
|
||||
#if PY_VERSION_HEX >= 0x03020000
|
||||
# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
|
||||
#else
|
||||
# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
|
||||
#endif
|
||||
%}
|
||||
|
||||
|
||||
|
|
@ -689,7 +695,7 @@ namespace swig
|
|||
SWIG_Error(SWIG_TypeError, "Slice object expected.");
|
||||
return NULL;
|
||||
}
|
||||
PySlice_GetIndices(slice, self->size(), &i, &j, &step);
|
||||
PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
|
||||
return swig::getslice(self, i, j);
|
||||
}
|
||||
|
||||
|
|
@ -700,7 +706,7 @@ namespace swig
|
|||
SWIG_Error(SWIG_TypeError, "Slice object expected.");
|
||||
return;
|
||||
}
|
||||
PySlice_GetIndices(slice, self->size(), &i, &j, &step);
|
||||
PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
|
||||
swig::setslice(self, i, j, v);
|
||||
}
|
||||
|
||||
|
|
@ -711,7 +717,7 @@ namespace swig
|
|||
SWIG_Error(SWIG_TypeError, "Slice object expected.");
|
||||
return;
|
||||
}
|
||||
PySlice_GetIndices(slice, self->size(), &i, &j, &step);
|
||||
PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
|
||||
swig::delslice(self, i,j);
|
||||
}
|
||||
|
||||
|
|
@ -722,7 +728,7 @@ namespace swig
|
|||
SWIG_Error(SWIG_TypeError, "Slice object expected.");
|
||||
return;
|
||||
}
|
||||
PySlice_GetIndices(slice, self->size(), &i, &j, &step);
|
||||
PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
|
||||
swig::delslice(self, i,j);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue