summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkos Chandras <hwoarang@gentoo.org>2011-06-24 20:39:52 +0000
committerMarkos Chandras <hwoarang@gentoo.org>2011-06-24 20:39:52 +0000
commit7ccec00f4500eb965b237d323407fa5809e604dd (patch)
tree74bf5ebfe805828df10769ef7ddb91c840aeac8a /dev-python/sip/files
parentBump -5.11 development version (diff)
downloadgentoo-2-7ccec00f4500eb965b237d323407fa5809e604dd.tar.gz
gentoo-2-7ccec00f4500eb965b237d323407fa5809e604dd.tar.bz2
gentoo-2-7ccec00f4500eb965b237d323407fa5809e604dd.zip
Backport fix for compatibility with Python 3.2 (bug #365549) and fix for a regression from python overlay. Requested by Arfrever
(Portage version: 2.1.9.49/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/sip/files')
-rw-r--r--dev-python/sip/files/sip-4.12.3-python-3.2.patch44
-rw-r--r--dev-python/sip/files/sip-4.12.3-sip_api_is_py_method.patch17
2 files changed, 61 insertions, 0 deletions
diff --git a/dev-python/sip/files/sip-4.12.3-python-3.2.patch b/dev-python/sip/files/sip-4.12.3-python-3.2.patch
new file mode 100644
index 000000000000..fcad6a08afe6
--- /dev/null
+++ b/dev-python/sip/files/sip-4.12.3-python-3.2.patch
@@ -0,0 +1,44 @@
+--- 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)
diff --git a/dev-python/sip/files/sip-4.12.3-sip_api_is_py_method.patch b/dev-python/sip/files/sip-4.12.3-sip_api_is_py_method.patch
new file mode 100644
index 000000000000..825e943d7cf1
--- /dev/null
+++ b/dev-python/sip/files/sip-4.12.3-sip_api_is_py_method.patch
@@ -0,0 +1,17 @@
+http://www.riverbankcomputing.co.uk/hg/sip/rev/f9f4b161c940
+
+--- siplib/siplib.c.in
++++ siplib/siplib.c.in
+@@ -7604,9 +7604,10 @@
+ #endif
+
+ /*
+- * Check any possible reimplementation is not the wrapped C++ method.
++ * Check any possible reimplementation is not the wrapped C++ method or
++ * a default special method implementation..
+ */
+- if (cls_dict != NULL && (cls_attr = PyDict_GetItem(cls_dict, mname_obj)) != NULL && Py_TYPE(cls_attr) != &sipMethodDescr_Type)
++ if (cls_dict != NULL && (cls_attr = PyDict_GetItem(cls_dict, mname_obj)) != NULL && Py_TYPE(cls_attr) != &sipMethodDescr_Type && Py_TYPE(cls_attr) != &PyWrapperDescr_Type)
+ {
+ reimp = cls_attr;
+ break;