summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2013-07-18 15:18:34 +0000
committerJustin Lecher <jlec@gentoo.org>2013-07-18 15:18:34 +0000
commit073cb357fdfa0d10680454a267897550c11b596a (patch)
treeb8a7c0ffd52bd4d916e6430d657aea73dca45831 /dev-python/mpmath/files
parentVersion bump. (diff)
downloadgentoo-2-073cb357fdfa0d10680454a267897550c11b596a.tar.gz
gentoo-2-073cb357fdfa0d10680454a267897550c11b596a.tar.bz2
gentoo-2-073cb357fdfa0d10680454a267897550c11b596a.zip
dev-python/mpmath: Backport compatibility for gmpy-2, #477098
(Portage version: 2.2.0_alpha188/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)
Diffstat (limited to 'dev-python/mpmath/files')
-rw-r--r--dev-python/mpmath/files/mpmath-0.17-gmpy2.patch19
1 files changed, 19 insertions, 0 deletions
diff --git a/dev-python/mpmath/files/mpmath-0.17-gmpy2.patch b/dev-python/mpmath/files/mpmath-0.17-gmpy2.patch
new file mode 100644
index 000000000000..7e1093d60bd3
--- /dev/null
+++ b/dev-python/mpmath/files/mpmath-0.17-gmpy2.patch
@@ -0,0 +1,19 @@
+Index: mpmath/libmp/libintmath.py
+===================================================================
+--- mpmath/libmp/libintmath.py (revision 1234)
++++ mpmath/libmp/libintmath.py (revision 1235)
+@@ -298,8 +298,12 @@
+ sqrt_fixed2 = sqrt_fixed
+
+ if BACKEND == 'gmpy':
+- isqrt_small = isqrt_fast = isqrt = gmpy.sqrt
+- sqrtrem = gmpy.sqrtrem
++ if gmpy.version() >= '2':
++ isqrt_small = isqrt_fast = isqrt = gmpy.isqrt
++ sqrtrem = gmpy.isqrt_rem
++ else:
++ isqrt_small = isqrt_fast = isqrt = gmpy.sqrt
++ sqrtrem = gmpy.sqrtrem
+ elif BACKEND == 'sage':
+ isqrt_small = isqrt_fast = isqrt = \
+ getattr(sage_utils, "isqrt", lambda n: MPZ(n).isqrt())