void-packages/srcpkgs/sagemath/patches/36006-gmp_6.3.0.patch
Gonzalo Tornaría 5d8e4da91f sagemath: patch and rebuild for ecl-23.9.9
Also add a patch to support matplotlib 3.8.0
2023-09-23 00:06:22 +02:00

39 lines
1.4 KiB
Diff

diff --git a/src/sage/ext/memory.pyx b/src/sage/ext/memory.pyx
index 1de6dedab82..b95130b19dd 100644
--- a/src/sage/ext/memory.pyx
+++ b/src/sage/ext/memory.pyx
@@ -3,14 +3,14 @@ Low-level memory allocation functions
TESTS:
-Check that a ``MemoryError`` is raised if we try to allocate a
+Check that an error is raised if we try to allocate a
ridiculously large integer, see :trac:`15363`::
- sage: 2^(2^63-3)
- Traceback (most recent call last):
- ...
- OverflowError: exponent must be at most 2147483647 # 32-bit
- RuntimeError: Aborted # 64-bit
+ sage: try:
+ ....: 2^(2^63-3)
+ ....: except (OverflowError, RuntimeError, FloatingPointError):
+ ....: print ('Overflow error')
+ ...Overflow error
AUTHORS:
diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
index d5e87626d31..37ed9364845 100644
--- a/src/sage/rings/integer.pyx
+++ b/src/sage/rings/integer.pyx
@@ -6654,7 +6654,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
sage: try:
....: print('Possible error output from gmp', flush=True)
....: 1 << (2^60)
- ....: except (MemoryError, OverflowError, RuntimeError):
+ ....: except (MemoryError, OverflowError, RuntimeError, FloatingPointError):
....: pass
....: else:
....: print("Failed to raise exception")