2011-06-20 18:45:25 Arfrever Frehtes Taifersar Arahesis napisaĆ(a): > sipConvertFromSliceObject() macro is incompatible with Python 3.2. > Please see comment #0 in: > https://bugs.gentoo.org/show_bug.cgi?id=365549 > > The patch for SIP: > https://365549.bugs.gentoo.org/attachment.cgi?id=271739
It might be appropriate to also update some code in siplib/voidptr.c. I'm attaching updated patch. -- Arfrever Frehtes Taifersar Arahesis
--- siplib/sip.h.in
+++ siplib/sip.h.in
@@ -1553,9 +1553,15 @@
#define sipIsExactWrappedType(wt) (sipTypeAsPyTypeObject((wt)->type) == (PyTypeObject *)(wt))
+#if PY_VERSION_HEX >= 0x03020000
+#define sipConvertFromSliceObject(o,len,start,stop,step,slen) \
+ PySlice_GetIndicesEx((o), (len), (start), (stop), \
+ (step), (slen))
+#else
#define sipConvertFromSliceObject(o,len,start,stop,step,slen) \
PySlice_GetIndicesEx((PySliceObject *)(o), (len), (start), (stop), \
(step), (slen))
+#endif
/*
--- siplib/voidptr.c
+++ siplib/voidptr.c
@@ -429,7 +429,11 @@
{
Py_ssize_t start, stop, step, slicelength;
+#if PY_VERSION_HEX >= 0x03020000
+ if (PySlice_GetIndicesEx(key, v->size, &start, &stop, &step, &slicelength) < 0)
+#else
if (PySlice_GetIndicesEx((PySliceObject *)key, v->size, &start, &stop, &step, &slicelength) < 0)
+#endif
return NULL;
if (step != 1)
@@ -486,7 +490,11 @@
{
Py_ssize_t stop, step;
+#if PY_VERSION_HEX >= 0x03020000
+ if (PySlice_GetIndicesEx(key, v->size, &start, &stop, &step, &size) < 0)
+#else
if (PySlice_GetIndicesEx((PySliceObject *)key, v->size, &start, &stop, &step, &size) < 0)
+#endif
return -1;
if (step != 1)
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
