From: Zbigniew Jędrzejewski-S. <zb...@in...> - 2014-04-01 21:10:46
|
Various fields PySequenceMethods were deprecated, but not actually removed from the structure. This means that they should be filled with 0's. --- pymoose/ematrix.cpp | 14 ++++++++------ pymoose/moosemodule.h | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pymoose/ematrix.cpp b/pymoose/ematrix.cpp index 726ca05..72d9558 100644 --- a/pymoose/ematrix.cpp +++ b/pymoose/ematrix.cpp @@ -123,13 +123,13 @@ extern "C" { 0, //sq_concat 0, //sq_repeat (ssizeargfunc)moose_Id_getItem, //sq_item -#ifndef PY3K +#ifdef PY3K + 0, // was_sq_slice +#else (ssizessizeargfunc)moose_Id_getSlice, // getslice #endif - 0, //sq_ass_item -#ifndef PY3K - 0, // setslice -#endif + 0, // sq_ass_item + 0, // sq_ass_slice / was_sq_ass_slice (objobjproc)moose_Id_contains, // sq_contains 0, // sq_inplace_concat 0 // sq_inplace_repeat @@ -563,7 +563,8 @@ extern "C" { ret->oid_ = ObjId(self->id_, index); return (PyObject*)ret; } - + +#ifndef PY3K PyObject * moose_Id_getSlice(_Id * self, PyObject * args) { if (!Id::isValid(self->id_)){ @@ -599,6 +600,7 @@ extern "C" { } return ret; } +#endif /////////////////////////////////////////////////// // Mapping protocol diff --git a/pymoose/moosemodule.h b/pymoose/moosemodule.h index e01b323..5b2b6e6 100644 --- a/pymoose/moosemodule.h +++ b/pymoose/moosemodule.h @@ -174,7 +174,9 @@ extern "C" { /* Id functions to allow part of sequence protocol */ Py_ssize_t moose_Id_getLength(_Id * self); PyObject * moose_Id_getItem(_Id * self, Py_ssize_t index); +#ifndef PY3K PyObject * moose_Id_getSlice(_Id * self, PyObject * args); +#endif PyObject * moose_Id_getShape(_Id * self); PyObject * moose_Id_subscript(_Id * self, PyObject * op); PyObject * moose_Id_richCompare(_Id * self, PyObject * args, int op); -- 1.8.5.3 |