summarylogtreecommitdiffstats
path: root/sagemath-cython-0.29.patch
diff options
context:
space:
mode:
authorAntonio Rojas2018-10-21 08:50:04 +0000
committerAntonio Rojas2018-10-21 08:50:04 +0000
commitf49b668fbc044f0b7b8eb3a646002738bb6bce52 (patch)
tree4a39d85688108a57b2b1260fd69e8c00179ae8bd /sagemath-cython-0.29.patch
parenta0714fa9d94ceae7f8a69e511159e96fe62d6d97 (diff)
downloadaur-f49b668fbc044f0b7b8eb3a646002738bb6bce52.tar.gz
Sync with [community]
Diffstat (limited to 'sagemath-cython-0.29.patch')
-rw-r--r--sagemath-cython-0.29.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/sagemath-cython-0.29.patch b/sagemath-cython-0.29.patch
new file mode 100644
index 000000000000..e47a724c0996
--- /dev/null
+++ b/sagemath-cython-0.29.patch
@@ -0,0 +1,65 @@
+diff --git a/src/sage/arith/long.pxd b/src/sage/arith/long.pxd
+index b8cc019..c7a1d8e 100644
+--- a/src/sage/arith/long.pxd
++++ b/src/sage/arith/long.pxd
+@@ -19,7 +19,7 @@ from cpython.object cimport Py_SIZE
+ from cpython.int cimport PyInt_AS_LONG
+ from cpython.long cimport PyLong_AsLong
+ from cpython.number cimport PyNumber_Index, PyIndex_Check
+-from cpython.longintrepr cimport PyLongObject, PyLong_SHIFT, digit
++from cpython.longintrepr cimport py_long, PyLong_SHIFT, digit
+
+ from sage.libs.gmp.mpz cimport mpz_fits_slong_p, mpz_get_si
+ from sage.rings.integer_fake cimport is_Integer, Integer_AS_MPZ
+@@ -208,7 +208,7 @@ cdef inline bint integer_check_long_py(x, long* value, int* err):
+ return 0
+
+ # x is a Python "long" (called "int" on Python 3)
+- cdef const digit* D = (<PyLongObject*>x).ob_digit
++ cdef const digit* D = (<py_long>x).ob_digit
+ cdef Py_ssize_t size = Py_SIZE(x)
+
+ # We assume that PyLong_SHIFT is 15 on a 32-bit system and 30 on a
+diff --git a/src/sage/libs/gmp/pylong.pyx b/src/sage/libs/gmp/pylong.pyx
+index 168e485..9c214f6 100644
+--- a/src/sage/libs/gmp/pylong.pyx
++++ b/src/sage/libs/gmp/pylong.pyx
+@@ -28,7 +28,7 @@ AUTHORS:
+ from cpython.object cimport Py_SIZE
+ from cpython.int cimport PyInt_FromLong
+ from cpython.long cimport PyLong_FromLong
+-from cpython.longintrepr cimport _PyLong_New, PyLongObject, digit, PyLong_SHIFT
++from cpython.longintrepr cimport _PyLong_New, py_long, digit, PyLong_SHIFT
+ from .mpz cimport *
+
+ cdef extern from *:
+@@ -54,7 +54,7 @@ cdef mpz_get_pylong_large(mpz_srcptr z):
+ cdef size_t nbits = mpz_sizeinbase(z, 2)
+ cdef size_t pylong_size = (nbits + PyLong_SHIFT - 1) // PyLong_SHIFT
+ L = _PyLong_New(pylong_size)
+- mpz_export((<PyLongObject*>L).ob_digit, NULL,
++ mpz_export(L.ob_digit, NULL,
+ -1, sizeof(digit), 0, PyLong_nails, z)
+ if mpz_sgn(z) < 0:
+ # Set correct size (use a pointer to hack around Cython's
+@@ -91,7 +91,7 @@ cdef int mpz_set_pylong(mpz_ptr z, L) except -1:
+ if pylong_size < 0:
+ pylong_size = -pylong_size
+ mpz_import(z, pylong_size, -1, sizeof(digit), 0, PyLong_nails,
+- (<PyLongObject*>L).ob_digit)
++ (<py_long>L).ob_digit)
+ if Py_SIZE(L) < 0:
+ mpz_neg(z, z)
+
+diff --git a/src/setup.py b/src/setup.py
+index 6a89cf8..bc8fe12 100755
+--- a/src/setup.py
++++ b/src/setup.py
+@@ -284,6 +284,7 @@ class sage_build_cython(Command):
+ cdivision=True,
+ embedsignature=True,
+ fast_getattr=True,
++ language_level="2",
+ preliminary_late_includes_cy28=True,
+ profile=self.profile,
+ )