void-packages/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

44 lines
1.6 KiB
Diff

diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
index 99287dec718..98011970404 100644
--- a/src/sage/interfaces/ecm.py
+++ b/src/sage/interfaces/ecm.py
@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
"""
n = self._validate(n)
kwds.setdefault('c', 1000000000)
- kwds.setdefault('I', 1)
if factor_digits is not None:
B1 = self.recommended_B1(factor_digits)
kwds['one'] = True
diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
index 886a9b816e4..83fb7adaf8d 100644
--- a/src/sage/libs/libecm.pyx
+++ b/src/sage/libs/libecm.pyx
@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
Some special cases::
sage: ecmfactor(1, 100)
- (True, 1, ...)
+ Traceback (most recent call last):
+ ...
+ ValueError: Input number (1) must be greater than 1
sage: ecmfactor(0, 100)
Traceback (most recent call last):
...
- ValueError: Input number (0) must be positive
+ ValueError: Input number (0) must be greater than 1
"""
cdef mpz_t n, f
cdef int res
@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
sage_int_number = Integer(number)
sage_int_sigma = Integer(sigma)
- if number <= 0:
- raise ValueError("Input number (%s) must be positive"%number)
+ if number <= 1:
+ raise ValueError("Input number (%s) must be greater than 1"%number)
if verbose:
print("Performing one curve with B1=%1.0f" % B1)