summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2015-09-30 18:14:34 +0200
committerDomen Kožar <domen@dev.si>2015-09-30 18:15:21 +0200
commitd8c1284d816f966f2815d75e8041464301c14f94 (patch)
tree254841dc3a6b149de20f7b3191e2f6b25144fc2e /pkgs/development/python-modules
parent3e600a805d7f89b520d68e7d51afd1a9ba936796 (diff)
downloadnixlib-d8c1284d816f966f2815d75e8041464301c14f94.tar
nixlib-d8c1284d816f966f2815d75e8041464301c14f94.tar.gz
nixlib-d8c1284d816f966f2815d75e8041464301c14f94.tar.bz2
nixlib-d8c1284d816f966f2815d75e8041464301c14f94.tar.lz
nixlib-d8c1284d816f966f2815d75e8041464301c14f94.tar.xz
nixlib-d8c1284d816f966f2815d75e8041464301c14f94.tar.zst
nixlib-d8c1284d816f966f2815d75e8041464301c14f94.zip
pythonPackages: bump pyramid, webob and btrees
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/btrees-py35.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/btrees-py35.patch b/pkgs/development/python-modules/btrees-py35.patch
new file mode 100644
index 000000000000..77e47d670b9b
--- /dev/null
+++ b/pkgs/development/python-modules/btrees-py35.patch
@@ -0,0 +1,79 @@
+From eee0beef88d135640871050b40844272a3aee790 Mon Sep 17 00:00:00 2001
+From: Tres Seaver <tseaver@palladion.com>
+Date: Tue, 15 Sep 2015 17:20:18 -0400
+Subject: [PATCH 1/2] Ensure that we don't overlook errors in first
+ PyObject_RichCompareBool call.
+
+Python 3.5 turns such cases into SystemErrors.
+
+See: https://bugs.python.org/issue23571
+
+Fixes #15.
+---
+ BTrees/_compat.h | 22 +++++++++++++++++++---
+ 1 file changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/BTrees/_compat.h b/BTrees/_compat.h
+index e004d54..19dd377 100644
+--- a/BTrees/_compat.h
++++ b/BTrees/_compat.h
+@@ -27,9 +27,25 @@
+ #define TEXT_FROM_STRING PyUnicode_FromString
+ #define TEXT_FORMAT PyUnicode_Format
+ 
+-#define COMPARE(lhs, rhs) \
+-    PyObject_RichCompareBool((lhs), (rhs), Py_LT) > 0 ? -1 : \
+-    (PyObject_RichCompareBool((lhs), (rhs), Py_EQ) > 0 ? 0 : 1)
++/* Emulate Python2's __cmp__,  wrapping PyObject_RichCompareBool(),
++ * Return -2/-3 for errors, -1 for lhs<rhs, 0 for lhs==rhs, 1 for lhs>rhs.
++ */
++static inline
++int __compare(PyObject *lhs, PyObject *rhs) {
++    int less, equal;
++
++    less = PyObject_RichCompareBool(lhs, rhs, Py_LT);
++    if ( less == -1 ) {
++        return -2;
++    }
++    equal = PyObject_RichCompareBool(lhs, rhs, Py_EQ);
++    if ( equal == -1 ) {
++        return -3;
++    }
++    return less ? -1 : (equal ? 0 : 1);
++}
++
++#define COMPARE(lhs, rhs) __compare((lhs), (rhs))
+ 
+ 
+ #else
+
+From ff4c3309fe471f2b9bdd642b8f7d1c2fe0f5e458 Mon Sep 17 00:00:00 2001
+From: Tres Seaver <tseaver@palladion.com>
+Date: Sun, 20 Sep 2015 11:07:10 -0400
+Subject: [PATCH 2/2] Avoid unnecessary comparison for 'Py_EQ' if 'Py_LT'
+ returned True.
+
+---
+ BTrees/_compat.h | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/BTrees/_compat.h b/BTrees/_compat.h
+index 19dd377..ece2bf9 100644
+--- a/BTrees/_compat.h
++++ b/BTrees/_compat.h
+@@ -38,11 +38,14 @@ int __compare(PyObject *lhs, PyObject *rhs) {
+     if ( less == -1 ) {
+         return -2;
+     }
++    if (less) {
++        return -1;
++    }
+     equal = PyObject_RichCompareBool(lhs, rhs, Py_EQ);
+     if ( equal == -1 ) {
+         return -3;
+     }
+-    return less ? -1 : (equal ? 0 : 1);
++    return equal ? 0 : 1;
+ }
+ 
+ #define COMPARE(lhs, rhs) __compare((lhs), (rhs))