diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/pycontainer.swg --- swig-2.0.3/Lib/python/pycontainer.swg.rh666429 2010-10-19 08:31:31.000000000 +0200 +++ swig-2.0.3/Lib/python/pycontainer.swg 2011-04-22 15:42:42.185982189 +0200 @@ -630,6 +630,7 @@ namespace swig return x; } +#if !NO_PYSLICE /* typemap for slice object support */ %typemap(in) PySliceObject* { $1 = (PySliceObject *) $input; @@ -637,6 +638,7 @@ namespace swig %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) PySliceObject* { $1 = PySlice_Check($input); } +#endif Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) { return swig::getslice(self, i, j); @@ -659,7 +661,11 @@ namespace swig /* Overloaded methods for Python 3 compatibility * (Also useful in Python 2.x) */ +#if NO_PYSLICE + Sequence* __getitem__(PyObject *slice) throw (std::out_of_range) { +#else Sequence* __getitem__(PySliceObject *slice) throw (std::out_of_range) { +#endif Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { SWIG_Error(SWIG_TypeError, "Slice object expected."); @@ -668,8 +674,11 @@ namespace swig PySlice_GetIndices(slice, self->size(), &i, &j, &step); return swig::getslice(self, i, j); } - +#if NO_PYSLICE + void __setitem__(PyObject *slice, const Sequence& v) +#else void __setitem__(PySliceObject *slice, const Sequence& v) +#endif throw (std::out_of_range, std::invalid_argument) { Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { @@ -680,7 +689,11 @@ namespace swig swig::setslice(self, i, j, v); } +#if NO_PYSLICE + void __delitem__(PyObject *slice) +#else void __delitem__(PySliceObject *slice) +#endif throw (std::out_of_range) { Py_ssize_t i, j, step; if( !PySlice_Check(slice) ) { diff -up swig-2.0.3/Source/Modules/python.cxx.rh666429 swig-2.0.3/Source/Modules/python.cxx --- swig-2.0.3/Source/Modules/python.cxx.rh666429 2011-03-14 08:22:08.000000000 +0100 +++ swig-2.0.3/Source/Modules/python.cxx 2011-04-22 15:43:45.122661120 +0200 @@ -438,6 +438,7 @@ public: if (py3) { /* force disable features that not compatible with Python 3.x */ classic = 0; + Preprocessor_define((DOH *) "NO_PYSLICE 1", 0); } if (cppcast) {