diff options
author | Markos Chandras <hwoarang@gentoo.org> | 2011-06-24 20:39:52 +0000 |
---|---|---|
committer | Markos Chandras <hwoarang@gentoo.org> | 2011-06-24 20:39:52 +0000 |
commit | 7ccec00f4500eb965b237d323407fa5809e604dd (patch) | |
tree | 74bf5ebfe805828df10769ef7ddb91c840aeac8a /dev-python/sip/files/sip-4.12.3-python-3.2.patch | |
parent | Bump -5.11 development version (diff) | |
download | gentoo-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/sip-4.12.3-python-3.2.patch')
-rw-r--r-- | dev-python/sip/files/sip-4.12.3-python-3.2.patch | 44 |
1 files changed, 44 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) |